首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

字段查询?该如何处理

2012-01-09 
字段查询????怎么查询表Face中字段id的最后一行,并获得取它的值???[解决办法]select top 1 idfrom faceord

字段查询????
怎么查询表Face中字段id的最后一行,并获得取它的值???

[解决办法]
select top 1 id
from face
order by id desc
[解决办法]
select top 1 id
from face
order by id desc
go
[解决办法]
select top 1 id from face order by id desc
[解决办法]
create table face(id int identity(1,1) primary key not null, face_id int )

insert into face

select 1 union all
select 1 union all
select 1 union all
select 1
[解决办法]
select scope_identity() as maxID

热点排行