Distinct在多个左连接查询中不起作用

时间:2015-10-09 05:04:49

标签: mysql mysqli left-join distinct-values

我没有使用下面的代码获得明显的价值。

SELECT DISTINCT dprofile.DbKey AS doctorDBKey, spe.DbKey AS specializationDbKey, spe.SpecializationName, 
dprofile.DoctorName, dprofile.HeadLine, dprofile.YearOfExperience, hprofile.DbKey AS hospitalDbKey, 
hprofile.HospitalName, loc.LocalAreaName, vtour.Longitude, vtour.Lattitude, sprice.Fees FROM specialization AS spe 
LEFT JOIN doctor_specialization AS dsep ON spe.DbKey = dsep.SpecializationDbKey 
LEFT JOIN doctor_profile AS dprofile ON dsep.DoctorDbKey = dprofile.DbKey 
LEFT JOIN slots_price_time AS sprice ON sprice.DoctorDbKey = dprofile.DbKey
LEFT JOIN hospital_profile AS hprofile ON sprice.HospitalDbKey = hprofile.DbKey
LEFT JOIN locality AS loc ON hprofile.LocalityDbKey = loc.DbKey 
LEFT JOIN hospital_virtual_toor AS vtour ON vtour.HospitalDbKey = hprofile.DbKey 
ORDER BY dprofile.DbKey LIMIT 0 , 30

0 个答案:

没有答案
相关问题