I have a table mdr with field iduser, msg_count,msg_received. I want to count the msg_count in the month of november on daywise data.
table mdr:--
iduer msg_count msg_receved
1 2 2011-11-06
2 4 2011-11-08
o/p like
iduser day1 day2 day3 day4
1 2 0 0 0
solve this type of query in mysql Dynamically.
Srinivasan RamamoorthiPosted Dec 10, 2021, 5:07 AM
If you want in row format use group by with date. If you want column format as mentioned in your question use pivot
https://www.c-sharpcorner.com/UploadFile/f0b2ed/pivot-and-unpovit-in-sql-server/