DB

mysql distinct 가 안될때

Devops mg 2020. 6. 15. 13:21

distinct 를 앞에 써줘야 한다.

 

 SELECT distinct i.lat,i.dong,i.AptName as aptname,i.code, i.lng
		FROM housedeal as d,houseInfo as i
		WHERE i.code = d.code
		and i.AptName = d.AptName                   
		ORDER BY AptName;

이건 되는데, 

이렇게 distinct 를 뒤의 컬럼에 붙이면 작동하지 않는다.