Jump to content

Unknown column


The Little Guy

Recommended Posts

SELECT *, a.answer as ans,COUNT(*) as total 
FROM phrases p 
LEFT JOIN answers a 
ON(p.id = a.phrase) 
WHERE p.id = 1 
AND total > 1 
GROUP BY a.answer 
ORDER BY total DESC

 

With the above I am getting an error saying: Unknown column 'total' in 'where clause'

This column is created, it holds a count, how can I only get results where the count (a.k.a. total) is larger than 1?

Link to comment
https://forums.phpfreaks.com/topic/205915-unknown-column/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.