I have this query
SELECT Date, IFNULL(Price, '------') AS Price
FROM productHistory
WHERE Date between '2012-08-15' and '2012-08-19' AND Company='AAA' AND Product='PPP'
GROUP BY Date
and the result is:
Date.......Price
-------------------
2012-08-15...100,00
2012-08-19...110,00
and it should be like this:
Date.........Price
-------------------------------------
2012-08-15......100,00
2012-08-16......--------
2012-08-17......--------
2012-08-18......--------
2012-08-19......110,00
I am working with only one table, I have checked similar quiestions in this forum but I could not find a solution.
When I get this, what I want to do is to add more Companies as columns in the query to get a result like this. well for this I have to change the query..
Date.........PriceCompany1.....PriceCompany2.....PriceCompany3
----------------------------------------------------------
2012-08-15......100,00................................100,00..................................100,0
2012-08-16......---------...............................100,00...................................---------
2012-08-17......---------..............................----------.................................110,00
2012-08-19......110,00..............................100,00..................................----------
What do I need to do?