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

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

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