求一条查询语句! 表1RID(自动增长) lType (int)表2RID(外键引用表1 RID)Result(boolean)要求查询出表1中,lType = 7 且 表2 没有的数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from 表1 where itpe=7 and rid not in(select rid from 表2) 传说这样查询速度会快点select * from 表1 where itpe=7 and not exists(select 1 from 表2 where 表1.rid=表2.rid) SELECT *FROM 表1 aWHERE ITYPE= 7 AND RID NOT IN (SELECT RID FROM 表2 ) select * from [表1] where itpe=7 and rid not in (select [表1].rid from [表1] inner join [表2] on [表1].rid = [表2].rid) select 表1.* from 表1left join 表2 on 表1.RID=表2.RIDwhere 表2.RID is null 快不快要看执行计划的,按照“建议”,用exists比not exists更快 求助Sql2000sp4,1053,1068错误,重装也不能解决? 执行顺序的问题 插入查询记录到另一表格的问题 求存储过程的语句 这个表怎么建啊! 大家知道后缀名为A03的文件是什么格式吗?可以用什么软件可以打开? sql的难题 一个统计的问题 关于SQL Server的问题,急需帮助,能者请进。40分 求教一段SQL,急! 求一条行列转换的SQL,大家帮我写下。 数据库时间划分问题
select * from 表1 where itpe=7 and not exists(select 1 from 表2 where 表1.rid=表2.rid)
FROM 表1 a
WHERE ITYPE= 7 AND RID NOT IN (SELECT RID FROM 表2 )
select * from [表1] where itpe=7 and rid not in (select [表1].rid from [表1] inner join [表2] on [表1].rid = [表2].rid)
left join 表2 on 表1.RID=表2.RID
where 表2.RID is null