select a.ip, b.start_ip, b.end_ip
from a left join b on a.id between b.start_ip and b.end_ip
where b.start_ip is null
from a left join b on a.id between b.start_ip and b.end_ip
where b.start_ip is null
解决方案 »
- Sql Sever中,“= ANY(子查询)”等同于“IN(子查询)”?
- 如何删除游标
- 怎么实现插入日期时间字段时,只插入日间时,字段不会默认生成1900-1-1?
- 请教 sql 中有转义符么
- @Data = GetDate() 得到的时间格式 09 14 2005 11:05AM ,但是我希望时间格式是2005-9-12 17:21:39,请问该怎么样做?
- 望指点:如何为别的数据库创建存储过程?
- 月平均购气量低于某值的SQL查询问题
- 大容量复制时出错,这样设置错在哪里?
- 我做一个统计的查询,有没有比较简单的sql语句呢?
- 关于查询的问题
- 使用jcreator api连接数据库问题:SQL Sever 2000 Driver for JDBC IError establish hing socket 如何解决
- [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
from a left join b on a.id between b.start_ip and b.end_ip
where b.start_ip is null
或
select ip
from a
where ip no in (
select a.ip
from a,b
where a.id between b.start_ip and b.end_ip)
from a left join b on a.id between b.start_ip and b.end_ip
where b.start_ip is null
或
select ip
from a
where ip not in ( --少写了个t
select a.ip
from a,b
where a.id between b.start_ip and b.end_ip)