I have this sql select statement:
Select ORDERS.ptDate as Date,Products.Description as Product,
ORDERDETAILS2.Quantity FROM ORDERS inner join ORDERDetails2 on Orders._id=ORDERDetails2.PtOrder inner join Products on Orderdetails2.ptproduct=Products.PtUnique order by date
which retutrns this kind of data:
2014-03-19 00:00:00;"Product a";"4"
2014-03-19 00:00:00;"Product c";"750"
2014-03-19 00:00:00;"Product a";"1"
2014-03-19 00:00:00;"Product b";"1"
2014-03-19 00:00:00;"Product c";"1075"
2014-03-20 00:00:00;"Product b";"2"
2014-03-20 00:00:00;"Product b";"1"
2014-03-20 00:00:00;"Product a";"2"
2014-03-20 00:00:00;"Product c";"2"
2014-03-20 00:00:00;"Product b";"25"
can I reproduce this having dates as columns , second column as rows and third column as aggegate function in sqlite? The result should be this:
Product 2014-03-19 2014-03-20
Product a 5 2
Product b 1 28
Product c 1825 2
Thanks for help