MySQL Forums
Forum List  »  Newbie

Re: ERROR 1054 (42S22): Unknown column 'COUNT' in 'field list'
Posted by: Peter Brawley
Date: October 27, 2018 02:02PM

> HAVING COUNT(*)=(SELECT COUNT
> FROM module);

That needs the COUNT() function, eg ...

( SELECT COUNT(DISTINCT moduleid) FROM modules )

You're in the territory of relational divison, see ...

https://www.red-gate.com/simple-talk/sql/learn-sql-server/high-performance-relational-division-in-sql-server/

"Who makes all the parts for a given assembly?" at https://www.artfulsoftware.com/queries.php

Options: ReplyQuote


Subject
Written By
Posted
Re: ERROR 1054 (42S22): Unknown column 'COUNT' in 'field list'
October 27, 2018 02:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.