Senthil Kumar
Senthil Kumar

Reputation: 69

Mysql Fetch count for last 5 days in date wise and remaining days count in 6th day

I have to fetch records for particular month as Count and date as two separate columns in which for last 5 days It should be group by date wise,And for the remaining days the count should be as 6th day Count as shown below, enter image description here

Upvotes: 1

Views: 71

Answers (1)

harish_sng
harish_sng

Reputation: 435

Use 2 queries: 1st query: (fetch for 5 days using group by) union 2nd query: (fetch rest of data using case statement).

Upvotes: 1

Related Questions