请问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.姓名) 分享数据库基础语句 js_szy 同学进来一下,我的分数给错了~~~~~ Mysql 双数据库问题 如何将nvarchar 转换为 varchar ,并且确保转换后的中文不会变成乱码???谢谢,问题解决,马上结帖. 一句超难的sql,高手进来帮我写一下,对了就给分 sql server2000的数据导入到sql server 2005 中如何保留列的默认值 如何去除指定字符后面全部字符? c程序问题 这个函数为什么提示我的 @table1 没有申明?我明明申明了呀? SQL SERVER基本问题请教 怎样对这张表进行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.姓名)