我的MYSQL查询相当复杂,我想从中删除空列
SELECT NamazTiming.FajarZamat,MasjidMaster.MasjidID_PK,MasjidMaster.MasjidName,MasjidMaster.Longitude,MasjidMaster.Latitude,MasjidMaster.Address,
SQRT( POW( 69.1 * (MasjidMaster.Latitude - 19.8) , 2 ) + POW( 69.1 * (75.4- MasjidMaster.Longitude) * COS(MasjidMaster.Latitude / 57.3 ) , 2 ) ) AS distance ,CityMaster.CityName
FROM MasjidMaster
LEFT JOIN CityMaster
ON MasjidMaster.CityID_FK = CityMaster.CityID_PK
LEFT JOIN NamazTiming
ON MasjidMaster.MasjidID_PK = NamazTiming.MasjidID_FK
HAVING distance < 10
ORDER BY NamazTiming.FajarZamat
Null列是NamazTiming.FajarZamat
答案 0 :(得分:0)
我相信您应该在ORDER BY之前将以下内容添加到您的查询中。这将删除该列为null的所有行。
WHERE NamazTiming.FajarZamat IS NOT NULL