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
Post a Comment