Thread: Db2 Sql Query
View Single Post
  #15 (permalink)  
Old 08-26-03, 04:28
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
Andy and Anto,

this construct (where (app_id,seq_id) not in ...) doesn't work at OS390 V6.1 either. For both cases, you'll have to wait until DB2 UDB V8 for zOS.
Using version 6 for OS390, you need a subselect.

SELECT ...
FROM mytable M1
WHERE seq_id = 1
AND NOT EXISTS
(SELECT 1
FROM mytable M2
WHERE M2.app_id = M1.app_id
AND M2.seq_id > 1)

HTH,
__________________
Rodney Krick
Reply With Quote