select * from 表 a where fyear=2003 and fmonth=2 and
not exists(select 1 from 表 where fyear=2003 and fmonth=1 and a.fbillid=fbillid and a.fempid=fempid)
not exists(select 1 from 表 where fyear=2003 and fmonth=1 and a.fbillid=fbillid and a.fempid=fempid)
解决方案 »
- SQL查询的问题
- 帮忙解决一个连接Excel数据库的问题
- 在vb.net中如何实现用sql server语句查询某一时间段的数据
- SQL语句nvarchar类型怎么自加1
- 我现在想加一个cc字段,而且cc字段的值是我指定的,但数据库里没有这些数据的,并且表A也没有这个字段。
- 求一条SQL语句 1列变2列
- 各位大虾,在线急等啊!!!SQL Server 7.0问题!!!
- 帮我看这个错误!挺简单的!
- 请问各位大下:MS-SQLSERVER2000(中文版)中能否使用MS-SQLSERVER7.0(英文版)中的完全数据库备份而生成的文件完成数据库的转移?
- 我想在运行程序时只对SQL数据库文件进行操作,不安装Sql?
- 不能读取临时表所生成的记录集合,请帮忙检查一下程序的错误
- 100分请教一个SQL语句的写法
insert @ values(2003, 1, 1 , 1)
insert @ values(2003, 1, 2, 1)
insert @ values(2003 , 1, 3 , 1)
insert @ values(2003 , 1, 4 , 1 )
insert @ values(2003 , 2, 1 , 1)
insert @ values(2003 , 2, 2 , 1)
select * from @ a where fyear=2003 and fmonth=1 and not exists(select 1 from @ where fyear=2003 and fmonth=2 and a.fbillid=fbillid and a.fempid=fempid)--还是:select * from @ a where fyear=2003 and fmonth=2 and not exists(select 1 from @ where fyear=2003 and fmonth=1 and a.fbillid=fbillid and a.fempid=fempid)