SQL Server : select same colums count by date -


hi guys table

l_date 2013-05-14 2013-05-12 2013-05-13 2013-05-15 

and need dates , count result l_date <= selected like:

l_date          count (<=) 2013-05-14        3 2013-05-12        1 2013-05-13        2 2013-05-15        4 

please try:

select      *,      (select count(*) yourtable b b.l_date<=a.l_date) [count (<=)]  yourtable 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -