deanblaster
Starting Member
2 Posts |
Posted - 2008-08-10 : 17:03:46
|
Hi all... I'm new to this forum, and am a beginner to SQL querying.Hopefully I can describe this in a way that makes sense.There's a table I'm working with containing budgeting information that features a column for each month with a dollar amount.I'd like to get a result set that has one line for each months amount.Here's an example of the way it looks:ACCOUNT_NAME, FISCAL_YEAR, BGT_SEPT, BGT_OCT, BGT_NOVTravel Expenses, 2008, $1,500.00, $2,000.00, $2,500.00 Entertainment Expenses, 2008, $5,200.00, $5,350.00, $5,125.00Here's an example of how I'd like my result set to look:ACCOUNT_NAME, FISCAL_YEAR, FISCAL__PERIOD, BGT_AMTTravel Expenses, 2008, 9, $1,500.00 Travel Expenses, 2008, 10, $2,000.00 Travel Expenses, 2008, 11, $2,500.00 Entertainment Expenses, 2008, 9, $5,200.00 Entertainment Expenses, 2008, 10, $5,350.00 Entertainment Expenses, 2008, 11, $5,125.00 Can someone please help me form a SELECT statement that would do this? I'm guessing I have to use a CASE statement.Thanks in advance from a frustrated beginnner :) |
|