请问sql语句 select a.* from 表1 a,表2 b where a.姓名<>b.姓名 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from 表1 where 姓名 not in (select distinct 姓名 from 表2) select * from 表1 where not exists (select 姓名 from 表2 where 表2.姓名=表1.姓名) select *from 表1where 表1.姓名 not exsist (select distinct 表2.姓名 from 表2) select * from 表1 awhere not exists( select 1 from 表2 where 姓名=a.姓名) 发扬拿来主义的精神,投机取巧一下:select 姓名 from 表1 awhere not exists( select 1 from 表2 where 姓名=a.姓名) select 姓名 from 库1.dbo.表1 awhere not exists( select 1 from 库2.dbo.表2 where 姓名=a.姓名)^_^!哈哈! 在库1里执行select a.* from 表1 a,库2.dbo.表2 b where a.姓名<>b.姓名或select 姓名 from 表1 awhere not exists( select 1 from 库2.dbo.表2 where 姓名=a.姓名) 求一统计T-SQL语句 sql查询语句问题 求SQL语句,谢谢! 请教:关于效率的简单问题 问一个问题,查询的问题,不知道能不能实现啊,比较着急,在线等,谢谢 关于SQL表间查询的问题! 求优化语句 如何导入数据库和保持数据库间的同步? 级联编码如何生成 如何取一个最大值??? 怎样对这张表进行Select??100分送上! 求救~~~~~关于distinct的问题
from 表1
where 表1.姓名 not exsist (select distinct 表2.姓名 from 表2)
select * from 表1 a
where not exists(
select 1 from 表2 where 姓名=a.姓名)
select 姓名 from 表1 a
where not exists(
select 1 from 表2 where 姓名=a.姓名)
where not exists(
select 1 from 库2.dbo.表2 where 姓名=a.姓名)^_^!哈哈!
select a.* from 表1 a,库2.dbo.表2 b where a.姓名<>b.姓名
或
select 姓名 from 表1 a
where not exists(
select 1 from 库2.dbo.表2 where 姓名=a.姓名)