jeudi 14 juillet 2016

MySQL Count name greater than a value

Please how can i check if a particular name is greater than a value in MySQL database. I want to do something like. SELECT id FROM table WHERE COUNT(name = 'john') > 2 i know this does not work, but i really need to do something like this.

An Example: A student studying CS, From New York, and grad point is 4.5 wants to check into a hostel. I have a hostel tables with fields course, state, and Grade_Point. i want to select the hostel_id where no same user with the same course > 2, state > 2 and grade_point > 2 are in the same room.

Aucun commentaire:

Enregistrer un commentaire