![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 03 Jun 2009 @ 10:08:00 GMT
Chaim, You can use RANK function.
Select NAME, DEPARTMENT
from TEST
Qualify RANK() OVER (Partition By DEPT Order by NAME desc) = 1
(You can sort with some other key instead of NAME e.g. EMPLOYEE_ID etc which would be a better idea) Hope this helps! Lakhwant Singh
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||