How do I format a select statment that will retrieve fields from multiple records based on coditi0ns:
example:
Table contains:
ID , month , days off count
123 , jan , 15
123 , feb , 8
123 , mar , 3
456 , jan , 2
456 , mar , 5
I want my select result to show:
123, 15 , 8 , 3
456, 2 , (null) , 5
so, I am retrieving all the rows for ID 123 & combining the results to one selected record. The table has unique index ID/month.
Any ideas?
example:
Table contains:
ID , month , days off count
123 , jan , 15
123 , feb , 8
123 , mar , 3
456 , jan , 2
456 , mar , 5
I want my select result to show:
123, 15 , 8 , 3
456, 2 , (null) , 5
so, I am retrieving all the rows for ID 123 & combining the results to one selected record. The table has unique index ID/month.
Any ideas?