首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

一句SQL语句的有关问题

2012-01-15 
一句SQL语句的问题select*fromAwherea1select*fromBwhereb2我想查出来a1的数据同时排除掉b2的数据请问

一句SQL语句的问题
select   *   from   A   where   a=1

select   *   from   B   where   b=2

我想查出来a=1的数据同时排除掉b=2的数据

请问如何用一个select的语句来实现?

[解决办法]
where a=1只显示a=1的数据啊,不明白LZ的意思
[解决办法]
有关联的主键么
[解决办法]
SQL Server的差集是比较难做的

如果是SQL Server 2005 简单一点

select * from A where a=1
EXCEPT
select * from B where b=2


[解决办法]
select * from A where a=1 and not in select * from B where b=2

这样的??
[解决办法]
SQL Server的差集 没有任何关联的两个表 要差集做什么。。。。不明白
[解决办法]
兩表有什么關聯嗎﹑?
[解决办法]
slect * from a where a=1 and b !=2
[解决办法]
select * from a where b not in(select * from where b=2) and a=1

热点排行