![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 27 Apr 2004 @ 18:50:18 GMT
Given the following set what is the SIMPLEST way to select PARENT, CHILD, MAX(AMT) where AMT is not null, but if AMT is null then select PARENT, MAX(CHILD). Where PARENT is CHAR(13), CHILD is CHAR(13) and AMT is DECIMAL(12,2)
PARENT CHILD AMT
X A NULL
X B NULL
X C NULL
This should give X, C, NULL
PARENT CHILD AMT
Y F 25.00
Y G 40.00
Y H NULL
This should give Y, G, 40
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 30 Jun 2008 | ||||||||||||||||||||||||||||||||||||||||||||||||