求一sql!谢谢 由表一和表二:当表二 id1 相同的项中text有大于0的项时则在搜索出表一所有项的结果时去除表二id1等于表一id1的项。即结果为:id1 id2 332 114330 114 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select *from tb1 twhere not exists (select 1 from tb2 where id1 = t.id1 and text > 0) select * from tb1 where id1 not in(select distinct id1 from tb2 where text > 0) delete from #t where exists (select 1 from #tb where id1 = #t.id1 and text > 0) 关于主从表统计问题 请问mssql的日志log文件到底有什么用处? SQL 时间比较问题! 把SQL SERVER 2000的数据库恢复到SQL SERVER 2005上去后,执行存储过程出错。 行转换为列,行为动态的 如何将HTML网页格式文件存入SQL2000?? 我现在数据库服务器名称是: you name 我想改为:liang 在哪儿改? 请问SQLSERVER语句可不可以这样? 在 SQL Server 的联机帮助里看到的 新人求帮助 mssql按照datetime栏位分组 请教一个小问题
select *
from tb1 t
where not exists (select 1 from tb2 where id1 = t.id1 and text > 0)
select * from tb1 where id1 not in(select distinct id1 from tb2 where text > 0)
where exists (select 1 from #tb where id1 = #t.id1 and text > 0)