select a from YouTable where convert(int,a)in(1,2,3,4,5,6,7,8,9,10)
解决方案 »
- 请教:带case when的check约束怎么写
- -500如何转换为500
- 请问哪位高手有MSSQLSERVER数据库版的邮件服务器?给我一份,谢谢!
- 关于查询的问题
- 高手门……sql里有没有简便的方法直接插入1列数据啊?
- 关于数据表的数据统计,有点难度,请高手指教,谢谢!!
- 在java中如何读写ntext字段的值?
- 我对触发器不熟悉,谁能帮我写个简单的东西
- 输入一个数字范围,检查数据库里的记录是否已包含
- 请问高手:在ORACLE中,CURRVAL,NEXTVAL伪列是于什么用的。可否举一个简单的SQL语句。
- 正版的SQL SERVER要多少钱?
- 求助:在bat文件中调用osql执行TRUCATE操作,返回-100的问题
select top 8000 identity(int,1,1) as N into numtab from
(select top 100 id=1 from sysobjects) as a,
(select top 100 id=1 from sysobjects) as b,
(select top 100 id=1 from sysobjects) as c
2,
select a.* from numtab a left join 你的表 b on a.n=cast(b.a as int)
where a.n<=(select cast(max(a) as int) from 你的表) and a.n>=(select cast(min(a) as int) from 你的表) and b.a is null结果
----
5
9
from 表 where right('0000'+convert(varchar(2),a),4) not in (Select a from 表)
and right('0000'+convert(varchar(2),a),4) <> (select max(a) from 表)
declare @i int
declare @str_row
select max(a) into @countx from a
for @i=1 to @countx
select a from table where a=right(10000+@i,4)
if @@rowcunt<1
@str_row=@str_row+@i+','
next
select @str_row