I tried to make a report to see a list of total records, grouped by month:
Which i found from articles:
SELECT Sum(someValues)
FROM Table
GROUP BY Year(date_feild), Month(date_feild), Day(date_feild)
what i wrote first:
select count(*),Year(entered_on) ,Month(entered_on)
from receipt_table
group by 2,3
I end up with:
select Year(entered_on) as Year,Month(entered_on) as Month,count(*)
from receipt_table
group by 1,2
order by 1,2
any comments guys?
I am Gayan Belpamulle and this is my web log. This blog includes stuff like my personal details, my photos, my dreams and also some of my nutty works... so, i will be posting my day to day catching to this blog.. enjoy!
Current Status
Actively playing with all possible backend services
15 December, 2010
Subscribe to:
Post Comments (Atom)
Some Popular Posts
-
M.D.K Healthcare Center & Hospital(pvt)Ltd is newly formed private Hospital at Horana with High Tech& High Skilled medical facilit...
-
Javascript: This is a good method taught to me by my friend to disable any character in the keyboard Within Forms in your web page/ web appl...
-
I had this note from long time in my Evernotes, I thought I should have post it here, so someone might find it useful. Why docker? Cont...
1 comment:
Thanks :)
Post a Comment