![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 22 Oct 2008 @ 15:24:09 GMT
Hi, The Select top n * from <table>; only returns the n rows specified. Is there a way to return the top 1 row for every group by? For example, I have a table shown below.
Sample_tbe
ID amt
001 300
001 301
001 299
002 500
002 499.34
002 500.84
...
How can I display only the first row by each ID? The result I want see is
Sample_tbe
ID amt
001 300
002 500
Thank you! Hui
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||