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

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -