Hi,
I have table structure in Sql Server as below
Table - VisitorHits
VisitorId (int-IDENTITY(1,1)) (Primary Key)
VisitorDate (date) (Unique)
Hits (int) (default 0)
I have hits for different unique date in this table of my website, I have admin panel and I want to show following details
Total Visitors, Visitors This Month, Visitor Today
I want to make Select Query such that the data will be fetch as follow
TotalVisitor | VisitorThisMonth | VisitorToday
92373 | 46350 | 4045
How can I achieve this row using single query
I know that,
first result will be Sum of Hits in table
second result will be count of hits of rows where month is same as current
third result will be Hits of current day.
But I need all this thing in single row.
Please help me in generating query.
Thanks :)