How to write the query using linq?
SELECT
(SELECT SUM([quantity] * [price_usd])
FROM [vi].[dbo].[SALES]
WHERE [type_id] =1 and [date_id] in(200701,200702,200703,200704,200705,200706,200707,200708,200709,200710,200711,200712)) as y2007,
(SELECT SUM([quantity] * [price_usd])
FROM [vi].[dbo].[SALES]
WHERE [type_id] =1 and [date_id] in(200801,200802,200803,200804,200805,200806,200807,200808,200809,200810,200811,200812)) as y2008,
(SELECT SUM([quantity] * [price_usd])
FROM [vi].[dbo].[SALES]
WHERE [type_id] =1 and [date_id] in(200901,200902,200903,200904,200905,200906,200907,200908,200909,200910,200911,200912)) as y2009
What about that kind of query:
I have no opportunity to try it on iPad, but the idea is clear and it should work.