-1
select DISTINCT IDDetail, NamaProperti, Provinsi, Kota, Area, TipeListing, JenisProperti, Hadapnya, JenisSertifikat, Harga, LT, LB, foto1 from MsProperti as mp, MsSertifikat as ms, MsDetail as md, MsTipeListing mt where md.IDProperti = mp.IDProperti and md.IDSertifikat = ms.IDSertifikat and md.IDTipeListing = mt.IDTipeListing and Provinsi = 'BSD' or Kota = 'BSD' or Area = 'BSD' and AlreadySold = 0 order by IDDetail desc
별다른 차이가 없다면 같은 데이터를 많이 줘야한다는 것을 알고있다. 그런 다음 Select를 선택하면 DISTINCT를 넣어서 동일한 데이터 만 제공한다. 그러나 그것은 전혀 다르지 않습니다.이 Distinct SQL 쿼리를 어떻게 해결할 것인가
아무 것도 제안하지 않습니까?
그리고 대답은 WHERE 쿼리 종료 후에 GROUP BY를 추가하는 것입니다. 이것은 asnwer
select IDDetail, NamaProperti, Provinsi, Kota, Area, TipeListing, JenisProperti, Hadapnya, JenisSertifikat, Harga, LT, LB, foto1
from MsProperti as mp, MsSertifikat as ms, MsDetail as md, MsTipeListing mt
where md.IDProperti = mp.IDProperti and
md.IDSertifikat = ms.IDSertifikat and
md.IDTipeListing = mt.IDTipeListing ".$tambahquery." and AlreadySold = 0
group by IDDetail
order by IDDetail desc
감사합니다.
이'그룹을 시도 by' 대신' – Jens
를 distinct'하지만 –
해결, 감사 청바지를 설명처럼이 쿼리 반환의 모든 데이터가 동일합니다. –