This is the next question:
SQL query with ORDER BY
But I think the SQL logic will be completely different, so I am posting it as a separate issue.
I am trying to expand my sql query SELECTand have some problems:
I have a table:
id type radius
-------------------------
1 type1 0.25
2 type2 0.59
3 type1 0.26
4 type1 0.78
5 type3 0.12
6 type2 0.45
7 type3 0.22
8 type3 0.98
and I'm trying to find out how the SELECT second smallest radius for each given type . Therefore, the returned recordset should look like this:
id type radius
-------------------------
3 type1 0.26
2 type2 0.59
7 type3 0.22
(Note: in the question I was looking for the lowest radius, not the second lowest radius).
I suppose I need to use LIMITand OFFSET, but if I use MIN(), it will not return a separate record containing the minimum radius?
- , ?
,