This is a discussion on how to specify the number of records to fetch within the DB2 forums, part of the Database Server Software category; --> hi can any body helps me for the equal statement at DB2 ver 7.0 for this statement at SQL? ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| to get the first 10 rows...... select column1 from table1 fetch first 10 rows only to get the top 10 rows........ select column1 from table1 order by column1 desc fetch first 10 rows only Graham Martin http://www.ibm.com/software/data/db2/migration/ |
| |||
| romina wrote: > can any body helps me for the equal statement at DB2 ver 7.0 for this > statement at SQL? > Select top 10 column1 from table1 SELECT * FROM table WHERE xxx ORDER BY yyy ASC FETCH FIRST 10 ROWS ONLY Bernd -- "Ja, alles meine Herren" sprach Fürst Lichnowsky. "Ooch det roochen?" "Ja, auch das Rauchen." "Ooch im Tiergarten?" "Ja, auch im Tiergarten darf geraucht werden, meine Herren." Und so endeten die Barrikadenkämpfe des 18. März in Berlin |
| |||
| romina wrote: > hi > can any body helps me for the equal statement at DB2 ver 7.0 for this > statement at SQL? > Select top 10 column1 from table1 Have a look at the DB2 manual, specifically here: http://publib.boulder.ibm.com/infoce...n/r0000875.htm -- Knut Stolze DB2 Information Integration Development IBM Germany |
| |||
| hi , tanks for ur help,I did it but this error happened: ILLEGAL USE OF KEYWORD FETCH, TOKEN , FOR WITH QUERYNO OPTIMIZE WAS EXPECTED I don't know why! -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums....m-db2/200511/1 |
| |||
| In article <573f8d3305960@uwe>, romina via DBMonster.com (u15590@uwe) says... > hi , > tanks for ur help,I did it but this error happened: > > ILLEGAL USE OF KEYWORD FETCH, TOKEN , FOR WITH QUERYNO OPTIMIZE WAS EXPECTED > > I don't know why! > > Which DB2 do you use, DB2 v7.0 on mainframe? |
| |||
| hi it's DB2 v6.0 on mainframe Gert van der Kooij wrote: >> hi , >> tanks for ur help,I did it but this error happened: >> >> ILLEGAL USE OF KEYWORD FETCH, TOKEN , FOR WITH QUERYNO OPTIMIZE WAS EXPECTED >> >> I don't know why! > >Which DB2 do you use, DB2 v7.0 on mainframe? -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums....m-db2/200511/1 |
| ||||
| hi it's DB2 v6.0 on mainframe Gert van der Kooij wrote: >> hi , >> tanks for ur help,I did it but this error happened: >> >> ILLEGAL USE OF KEYWORD FETCH, TOKEN , FOR WITH QUERYNO OPTIMIZE WAS EXPECTED >> >> I don't know why! > >Which DB2 do you use, DB2 v7.0 on mainframe? -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums....m-db2/200511/1 |