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

javascript - Confirm a form & display message if form is valid with JQuery -

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

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -