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.
db2 select a.job_id concat ',' concat z.job_id as all_jobs from (select job_id from t4 fetch first 1 row only) as a, (select job_id from (select job_id from t4 fetch first 2 rows only) as a except select * from (select job_id from t4 fetch first 1 row only) as b) as z
HTH
Nitin.
OOPS I FORGOT THIS WORKS FOR 2 ROWS U NEED TO MODIFY THE SAME FOR MANY ROWS.
Sorry this does not work. I just forgot to mention that I have db2 version 7.2 for Windows 2000. In DB2 v7.2 does not work the "fetch first n rows only" in subselect. This is a new feature in DB2 v8.
this won't work in general unless you consider common table expressions, which probably are no standard SQL, though.
Johann
Quote:
Originally posted by grofaty
Hi,
Sorry this does not work. I just forgot to mention that I have db2 version 7.2 for Windows 2000. In DB2 v7.2 does not work the "fetch first n rows only" in subselect. This is a new feature in DB2 v8.