Query help!

Techsavy

New member
Local time
Today, 15:08
Joined
May 4, 2008
Messages
6
Hi,

I have a table with five columns Date, Outfall1flow,Outfall2flow, Outfall3flow, outfall4flow

now I would like to have just three columns Date, OutfallFlow and OutfallID.

I would like to have flow only in one column identified by its id like 1,2,3,4..


How can I do this?

Thanks,
 
If I understand correctly

SELECT Date, Outfall1flow, 1 AS OutfallID
FROM TableName
UNION ALL
SELECT Date, Outfall2flow, 2 AS OutfallID
FROM TableName
UNION ALL
...

By the way, Date is a reserved word and not a good choice as a field name.
 

Users who are viewing this thread

Back
Top Bottom