tsql - How can I select an interval in t-sql? -


i want result for (int a=0; a<10; a++) { print(a); } in procedural language. thus, result should be

0 1 2 3 4 5 6 7 8 9 

yes, know not declarative thing, need. maybe windowing function trick? or procedural query?

use that:

with cte (     select 0 t     union     select t + 1 cte     t < 9 ) select * cte 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -