alt text http://img405.imageshack.us/img405/3929/33732138.png
另外一句话我想从列stuff1,stuff2和stuff3中获取数据,并将它们放在一起
答案 0 :(得分:2)
UNION命令应该足以满足你的目标:
SELECT practice, stuff1 FROM table
UNION ALL
SELECT practice, stuff2 FROM table
UNION ALL
SELECT practice, stuff3 FROM table
ORDER BY practice
答案 1 :(得分:1)
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