I have been banging my head against a wall at this now for a few hours. I have managed to get all the data I need down to 1 table, but I just can not figure out how to write a select statement so the output is the way I want.
Basically I have a table:
ID| Date | Cost
a 03/11 5
a 02/11 4
b 01/11 3
b 04/11 7
The column that changes the query column output is the date column. I would like to be able to group all the ID's together, with each row containing the ID and the cost of each item per month that pertains to that id, or null if there were no items that month (from jan-dec)
Output of query:
ID| JAN |FEB | MARCH | APR | MAY | JUN | JUL |......| OCT | NOV | DEC
a NULL 4 5 NULL NULL.................................NULL
b 3 NULL NULL 7 NULL.................................NULL
Any help in the right direction is appreciated!
Thank you.
03/11
(string) – JW 웃 Apr 5 at 2:24