2

i have this database

enter image description here

i want to select options_e if it has options less than 4, or something like this

SELECT * FROM `options` WHERE count(qid) <4 

so that it will return the result of options who are less than 4. but on phpmyadmin when i run the query, it says invalid use of group function. why do I get this error? who can i fix this?

1 Answer 1

2

You can try like this:

SELECT options_e, options_f, options_p, options_a, options_s  FROM `options`
GROUP BY options_e, options_f, options_p, options_a, options_s
HAVING count(qid) < 4
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.