Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subquery in SELECT clause
Message
From
31/07/2004 01:17:29
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00929817
Message ID:
00929840
Views:
9
>Here's IIF method.
SELECT id, ;
>	SUM(IIF(column_name = "January", value, 0) AS January, ;
>	...
>	SUM(IIF(column_name = "December", value, 0) AS December ;
>FROM mytable ;
>GROUP BY id
>
The other method makes it possible to write generic code, I believe.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform