![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
Another option is to use DISTINCT ON, so something like SELECT DISTINCT ON (Fld1) Fld3 FROM table ORDER BY Fld1, Fld2 DESC; But it's rather ugly. As usual, test with your own data to see how its performance compares with other approaches. I did not know this clause, good to know, it could be really useful. |
#22
| |||
| |||
|
|
Another option is to use DISTINCT ON, so something like SELECT DISTINCT ON (Fld1) Fld3 FROM table ORDER BY Fld1, Fld2 DESC; But it's rather ugly. As usual, test with your own data to see how its performance compares with other approaches. I did not know this clause, good to know, it could be really useful. |
#23
| |||
| |||
|
|
Another option is to use DISTINCT ON, so something like SELECT DISTINCT ON (Fld1) Fld3 FROM table ORDER BY Fld1, Fld2 DESC; But it's rather ugly. As usual, test with your own data to see how its performance compares with other approaches. I did not know this clause, good to know, it could be really useful. |
![]() |
| Thread Tools | |
| Display Modes | |
| |