February 15, 2006 at 5:18 pm
Table structure:
G_Code Num_Avail type
1 5 Blue
2 2 White
3 2 White
How can I create the following resultset:
[Available White] [Available Blue] [Total Available]
4 5 9
February 15, 2006 at 5:57 pm
Select SUM(case when type = 'White' then Num_Avail else NULL end) as Available_White, SUM(case when type = 'Blue' then Num_Avail else NULL end) as Available_Blue, SUM(Num_Avail) as Total Available
FROM <table_Name>
_____________
Code for TallyGenerator
February 15, 2006 at 6:03 pm
Thanks Sergiy. I really do appreciate your time and help.
February 15, 2006 at 6:05 pm
Thanks a million.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply