1

From the table as I want to get the rows contains minimum value of works as here is 3 so that I can get the rows of id 2 and 5 as both the rows has same minimum value.

ID   |   emailID                |   works
------------------------------------------
1    |   tree123@gmail.com      |   5
2    |   tree23@gmail.com       |   3
3    |   hello123@gmail.com     |   5
4    |   thistree123@gmail.com  |   4
5    |   somtng@gmail.com       |   3
Mutaealim
  • 127
  • 11

1 Answers1

1

"I want to get the rows that contain the minimum value of works" - You can get that by doing the following:

SELECT emailId 
FROM yourTable
WHERE works = (SELECT MIN(works) 
               FROM yourTable) 

Here is a demonstration of this query in action: SQL Fiddle

If this is not what you are looking for, please elaborate on your question.

Barry Piccinni
  • 1,685
  • 12
  • 23