tags:

views:

22

answers:

2

i have a table that looks like this:

alt text

another words i would like to take data from columns stuff1, stuff2, and stuff3, and put them together

+2  A: 

The UNION command should suffice for what you want to do:

SELECT practice, stuff1 FROM table
UNION ALL
SELECT practice, stuff2 FROM table
UNION ALL
SELECT practice, stuff3 FROM table
ORDER BY practice
Ryan Brunner
+1  A: 
select 
   practice, stuff1 as stuff, count(*)
from table
group by practice, stuff1
union
select 
   practice, stuff2 as stuff, count(*)
from table
group by practice, stuff2
union
select 
   practice, stuff3 as stuff, count(*)
from table
group by practice, stuff3
cdonner