数据库表 zmy
其列及数据如下:
m state
A 月
B 月
11 季
11 季
ZZ 年
XX 年

怎么写sql语句、并他们同行显示在同意表中?
急求解!!!
------解决思路----------------------
SELECT m.m , s.m , y.m
FROM (SELECT M FROM zmy WHERE STATE='月') as m,
(SELECT M FROM zmy WHERE STATE='季') as s,
(SELECT M FROM zmy WHERE STATE='年') as y
你这样试试!
------解决思路----------------------
set @anum = 0;
set @bnum =0;
set @cnum = 0;
select anum, bnum, cnum, A, B, C from
(select (@anum := @anum + 1) as anum, zmy.月度 as 月度 from zmy where zmy .A is not null) as AA ,
(select (@bnum := @bnum + 1) as bnum, zmy.季度 as 季度 from zmy where zmy .B is not null) as BB,
(select (@cnum := @cnum + 1) as cnum, zmy.年度 as 年度 from zmy where zmy .C is not null) as CC
where anum=bnum and bnum=cnum
行号一致