Tuesday, November 13, 2012

select 1 row from a table in DB

In Oracle, I do this:

select * from table where rownum = 1;

In DB2, I do this:

select * from table fetch first 1 row only;

In Informix, I do this:

select first 1 * from table;

Conclusion: To master SQL, don't think it is easy.

No comments: