Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with SELECT

Status
Not open for further replies.

UBfoolin

Programmer
Nov 29, 2001
32
US
If I have a table:

Key A B C
=== = = =
111 A B C
222 A E C
333 B A M

Is there a way to write a query to move the data from fields A, B and C into a single column named D, grouping by the Key field?

Desired result:

Key D
=== =
111 A
111 B
111 C
222 A
222 E
222 C
and so on.

Thanks for any advice on this.
 
select key, a from thing
union
select key, b from thing
union
select key, c from thing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top