Quote:
|
Originally Posted by vivek.vivek
Please help me in converting this statement to db2
... WHERE rownum<=1
|
Replace this by "FETCH FIRST ROW ONLY".
"WHERE rownum <= 7" would become "FETCH FIRST 7 ROWS ONLY".
The second part of "rownum <= 1 AND Rownum <= 1" is superfluous, so again this is "FETCH FIRST ROW ONLY".
The rownum in the subquery can be replaced similarly, at least when you are on DB2 9.