cheyuheng 2023-12-28 08:39 采纳率: 28.6%
浏览 4

在这样一个表里怎么根据多个parentId和content去查询共同的productId,要求多个数据是and连接的

在这样一个表里怎么根据多个parentId和content去查询共同的productId,要求多个数据是and连接的

img

  • 写回答

1条回答 默认 最新

  • 月亮与山与草 2023-12-28 14:12
    关注
    根据条件查询
    select prductId from table where parentId in ( 2390,2391,...,2395 )  and content in ( 'ABM','参考电压',...,'1' );
    
    根据条件查询并将结果合并为用and拼接的一个字符串
    select GROUP_CONCAT(`prductId ` SEPARATOR ' and ')  from table where parentId in ( 2390,2391,...,2395 )  and content in ( 'ABM','参考电压',...,'1' )
    
    
    
    评论

报告相同问题?

问题事件

  • 创建了问题 12月28日

悬赏问题

  • ¥15 需要手写数字信号处理Dsp三个简单题 不用太复杂
  • ¥15 数字信号处理考试111
  • ¥100 关于#audobe audition#的问题,如何解决?
  • ¥15 allegro17.2生成bom表是空白的
  • ¥15 请问一下怎么打通CAN通讯
  • ¥20 如何在 rocky9.4 部署 CDH6.3.2?
  • ¥35 navicat将excel中的数据导入mysql出错
  • ¥15 rt-thread线程切换的问题
  • ¥15 高通uboot 打印ubi init err 22
  • ¥15 R语言中lasso回归报错