您可以使用以下SQL查询来从表demand_delivery_command_item中获取header_id重复的行:\n\nsql\nSELECT *\nFROM demand_delivery_command_item\nWHERE header_id IN (\n\tSELECT header_id\n\tFROM demand_delivery_command_item\n\tGROUP BY header_id\n\tHAVING COUNT(header_id) > 1\n)\nORDER BY header_id;\n\n\n这个查询使用子查询来获取重复的header_id,然后在外部查询中使用IN子句来选择这些重复的行。最后,通过header_id进行排序以获得可读性更强的结果。


原文地址: https://www.cveoy.top/t/topic/pM1V 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录