表WOW
A B C
1 ss c01
1 ss c01
1 ss c01
2 tt c02
2 tt c02
问题:查出同A的B,和同B的C
求路人解之,不胜感激。
请详细描述您的需求,或给出所需结果
什么意思?
select b from ( select distinct a,b from wow ) as T_table
select c from (select distinct b,c from now) as T_table
不太理解
用子查询吧?
select B from where A in (1,2)
select C from where B in (ss,tt)
select a.B,a.C from wow a LEFT OUTER JOIN wow b on a.A = b.B and a.b = b.c
select distinct * from wow
这样?
Group By 不就解决了么?相同的会合并成为一个。单个的行与自身相同,显示出来也不错吧