1条回答 默认 最新
doukan3504 2019-01-05 05:12关注I believe you want to get the records with your two conditions group them by the ID and check if the count of rows in the group is 2, so that both conditions applied to that ID (assuming that the pair of
record_idandmeta_nameis unique).SELECT record_id FROM elbat WHERE meta_name = 'discount_percent' AND meta_value = '56' OR meta_name = 'discount_multiplier' AND meta_value = '30' GROUP BY record_id HAVING count(*) = 2;本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
