我有以下MySQL查询:
SELECT p.*, IF(COUNT(ms.PropertyID) > 0,1,0) AS Contacted, pm.MediaID, date_format(p.AvailableFrom, '%d %b %Y') AS 'AvailableFrom', astext(pg.Geometry) AS GeometryFROM property p, propertygeometry pg JOIN shortlist sl ON sl.PropertyID = p.id AND sl.MemberID = 384216 LEFT JOIN message ms ON ms.PropertyID = p.id AND ms.SenderID = 384216 LEFT JOIN property_media pm ON pm.PropertyID = p.id AND pm.IsPrimary = 1WHERE p.paused = 0 AND p.PropertyGeometryID = pg.idGROUP BY p.id
我收到此错误:
#1054-'on子句'中的未知列'p.id'
据我所知,查询看起来是正确的,知道发生什么了吗?
哔哔one
相关分类