select qh , case when (bw=0 or sw=0 or gw=0) then 0 else '' end as 0, case when (bw=1 or sw=1 or gw=1) then 1 else '' end as 1, case when (bw=2 or sw=2 or gw=2) then 2 else '' end as 2, case when (bw=3 or sw=3 or gw=3) then 3 else '' end as 3, case when (bw=4 or sw=4 or gw=4) then 4 else '' end as 4, case when (bw=5 or sw=5 or gw=5) then 5 else '' end as 5, case when (bw=6 or sw=6 or gw=6) then 6 else '' end as 6, case when (bw=7 or sw=7 or gw=7) then 7 else '' end as 7, case when (bw=8 or sw=8 or gw=8) then 8 else '' end as 8, case when (bw=9 or sw=9 or gw=9) then 9 else '' end as 9 from jb
在 zhang_yzy(六子儿)的帮助下完成。 代码如下: select qh, case when (bw=0 or sw=0 or gw=0) then 0 else null end as '0', case when (bw=1 or sw=1 or gw=1) then 1 else null end as '1', case when (bw=2 or sw=2 or gw=2) then 2 else null end as '2', case when (bw=3 or sw=3 or gw=3) then 3 else null end as '3', case when (bw=4 or sw=4 or gw=4) then 4 else null end as '4', case when (bw=5 or sw=5 or gw=5) then 5 else null end as '5', case when (bw=6 or sw=6 or gw=6) then 6 else null end as '6', case when (bw=7 or sw=7 or gw=7) then 7 else null end as '7', case when (bw=8 or sw=8 or gw=8) then 8 else null end as '8', case when (bw=9 or sw=9 or gw=9) then 9 else null end as '9' from jb
参考http://www.cnlot.net/3d/3D.php的结果。
我就是想要其中组选的结果。
第二行的位置我没有对好。
http://www.cnlot.net/3d/3D.php
就是上面组选部分。
如何实现。
qh ,
case when (bw=0 or sw=0 or gw=0) then 0 else '' end as 0,
case when (bw=1 or sw=1 or gw=1) then 1 else '' end as 1,
case when (bw=2 or sw=2 or gw=2) then 2 else '' end as 2,
case when (bw=3 or sw=3 or gw=3) then 3 else '' end as 3,
case when (bw=4 or sw=4 or gw=4) then 4 else '' end as 4,
case when (bw=5 or sw=5 or gw=5) then 5 else '' end as 5,
case when (bw=6 or sw=6 or gw=6) then 6 else '' end as 6,
case when (bw=7 or sw=7 or gw=7) then 7 else '' end as 7,
case when (bw=8 or sw=8 or gw=8) then 8 else '' end as 8,
case when (bw=9 or sw=9 or gw=9) then 9 else '' end as 9
from
jb
代码如下:
select
qh,
case when (bw=0 or sw=0 or gw=0) then 0 else null end as '0',
case when (bw=1 or sw=1 or gw=1) then 1 else null end as '1',
case when (bw=2 or sw=2 or gw=2) then 2 else null end as '2',
case when (bw=3 or sw=3 or gw=3) then 3 else null end as '3',
case when (bw=4 or sw=4 or gw=4) then 4 else null end as '4',
case when (bw=5 or sw=5 or gw=5) then 5 else null end as '5',
case when (bw=6 or sw=6 or gw=6) then 6 else null end as '6',
case when (bw=7 or sw=7 or gw=7) then 7 else null end as '7',
case when (bw=8 or sw=8 or gw=8) then 8 else null end as '8',
case when (bw=9 or sw=9 or gw=9) then 9 else null end as '9'
from
jb