I have a Table that has (names, money, date) And I would like to get the (name, money of month 1, money of month 2 and so on to month12)
How to do it?
I know how to extract the month from the date;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First query:
name, iif(month(date) = 1, money, 0) AS m1, and so on up to m12
Second query:
name, sum(m1) AS mo1, and so on up to mo12
group by name
Limitations: only one insert per month and the query must have an year filter that selects ONLY 1 YEAR.