I have a table with 3 fields f1,f2,f3 with the following content:
1 1 20
1 2 21
1 3 22
2 4 23
2 5 24
2 6 25
3 7 26
3 8 27
I want the script to return the folloing content:
1 1 20
2 4 23
3 7 26
what select do I have to write to get the following rows?
How do you determine which row to return for each unique f1?
Do you want {the "first"/lowest f2}, OR {the "first"/lowest f3}?
In your sample data, both would give the same result, so I can't tell for sure which condition you want your result based on.
Look at using MIN and GROUP BY