I need to get a result set containing the first N positive integers. Is it possible to use only standard SQL SELECT statement to get them (without any count table provided)?
Take a look at the following SO questions:
Edit:
Another aproach is to create a stored procedure that does that for you. PostgreSQL contains a function generate_series(start, stop) that does what you want.
select * from generate_series(2,4);
generate_series
-----------------
2
3
4
(3 rows)
I'm not familar with MySQL but somthing like that should be easy to implement, if you are okay with SPs. This site shows an implemetation.