houssam_ballout Posted February 18, 2008 Share Posted February 18, 2008 hello all,I am trying this sql:select count(OptionNb),comments from tblanswer where idQuestion = $idQuestion And OptionNb = 'option$i' and I got this errorMixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clauseHow could I solve it ?Thanks in advance Link to comment Share on other sites More sharing options...
Reg Edit Posted February 18, 2008 Share Posted February 18, 2008 How could I solve it ?Well, that depends on what you actually want the query to do! What data do you want it to return? A count, a set of rows, or what? Perhaps if you could give an example of some data you'd like to see returned from your query, we can suggest the right fix. Link to comment Share on other sites More sharing options...
Jack McKalling Posted February 27, 2008 Share Posted February 27, 2008 I can suggest something already:Using such function as COUNT, will return a single value, and selecting various columns will result in a set of rows (much more complex than just a value). If you want both returned, eg. a value and a set of rows, you should separate them in two SELECT queries Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.