+ 1

What will be the statement for this condition?

Suppose I have a table named students. I want to have the columns of name, class and marks of the students who has got the lowest marks. What will be the statement for this?

8th Aug 2016, 11:08 AM
Sarthak Mathur
Sarthak Mathur - avatar
3 Answers
+ 2
Ohh sorry my bad.. Try this SELECT * FROM `student` WHERE mark=(select min(mark) from student)
8th Aug 2016, 5:29 PM
Hardik Thaker
Hardik Thaker - avatar
0
It's simple.. SELECT name, class, MIN(marks) FROM students MIN() : MIN is a aggregate function. It is used to find the minimum value in the column. Hope you got that.
8th Aug 2016, 4:48 PM
Hardik Thaker
Hardik Thaker - avatar
0
I want only the name, class and marks of the student who has got the lowest marks. The statement that you have given shows the name and class of all of the students and the lowest marks.
8th Aug 2016, 5:16 PM
Sarthak Mathur
Sarthak Mathur - avatar