If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Db2 Sql Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #16 (permalink)  
Old 08-26-03, 14:54
lelle12 lelle12 is offline
Registered User
 
Join Date: Mar 2003
Posts: 82
Quote:
Originally posted by RKrick
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,
Without knowing anything about OS390 I assume that the following would also work in the scenario described:

SELECT app_id
FROM mytable M1
group by app_id
having count(seq_id) = 1

just a thought

/Lennart
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On