看看这个SQL语句怎么写?? b a c1 1 21 2 21 3 21 0 3要求可以把最后一条过滤掉,该怎么改呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你看到我给的例子了么就是这两个条件(a=0 or a=2)和b in (select b from table1 where a =1 or a =3)里要加入c的关联.这两个条件里的c要求是相等的 是这个意思吗?select * from table1join (select * from table1 where a=1 or a=3)kon b = k.b and c=k.cwhere a=0 or a=2 select * from (select * from table1 where a=0 or a=2 and b in (select b from table1 where a =1 or a =3))t where c=t.c to lsp69(浪子神剑)你的也提示t有语法错误怎么这样 select * from table1 awhere (a=0 or a=2) and exists(select 1 from table1 b where (a =1 or a =3) and a.b=b.b and a.c=b.c) lsqkeke(可可) 和 zhang_yzy(六子儿) 都可以后者的效果更好点能不能给我解释下给你们加分~~ 求一段SQL 请教下一条SQL题目... 请问我在查询分析器里建的表是只读的?? 存储过程 用另一个表的ID为表名 建表 求产品和配件关系表设计选择的取舍和查询语句 根据旧表创建新表? 求SQL语句 (希望有办法实现) sql2005 reporting service 报表服务能否动态生成列,请指点 select into的问题 在线等待,请各位高手帮忙解决,SELECT语句合并问题, 问一个函数! SQL SERVER 2000中英文版本不兼容的问题
就是这两个条件(a=0 or a=2)和b in (select b from table1 where a =1 or a =3)
里要加入c的关联.这两个条件里的c要求是相等的
select * from table1
join (select * from table1 where a=1 or a=3)k
on b = k.b and c=k.c
where a=0 or a=2
怎么这样
from table1 a
where (a=0 or a=2)
and exists(select 1
from table1 b
where (a =1 or a =3)
and a.b=b.b
and a.c=b.c)
后者的效果更好点能不能给我解释下
给你们加分~~