胡萝卜J

导航

 

1、先根据这个字段,使用count查询重复数据的重复个数

2、筛选count值是1的数据

例如:

SELECT
	* 
FROM
	(
	SELECT
		order_number AS number,
		count( order_number ) AS count 
	FROM
		( SELECT order_number FROM xx_orders WHERE use_status = 2 AND order_type != 4 ) AS ordery 
	WHERE
		order_number LIKE 'XD%' 
	GROUP BY
		order_number 
	) AS ordert 
WHERE
	ordert.count = 1

  

posted on 2024-03-07 14:52  胡萝卜J  阅读(19)  评论(0编辑  收藏  举报