在这样一个表里怎么根据多个parentId和content去查询共同的productId,要求多个数据是and连接的
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' )
解决 无用评论 打赏 举报