I have a table in my SQL database that looks like this:
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
I find it difficult to figure out how to define a query SELECTthat returns the lowest radius for each type.
In other words, the results I'm looking for will be as follows:
Results:
id type radius
-------------------------
1 type1 0.25
6 type2 0.45
7 type3 0.22
I suggest that I use ORDER BYto arrange the radius from the lowest to the highest level and capture the lowest. However, I also assume that I need to use DISTINCTfor a type, but I cannot figure out how to do this.
Does any SQL'ers expert have any ideas for this type of query SELECT? Any help is much appreciated!
Thanks a lot, Brett
source
share