select top 1 c_code as ls_code, c_desc as ls_desc from table where checksum(*) not in (select top 4 checksum(*) from table)
select top 1 c_code as ls_code, c_desc as ls_desc from (select top 5 * from table ) a order by a.id desc
select * from table 用where 语句限制想要列的条件 语法格式 where 列名=想要的值
select * from table 用where 语句限制想要列的条件 语法格式 where 列名=想要的值
“ select top 1 * from table5 where checksum(*) not in (select top 4 checksum(*) from table5) ” 这种查询方法,当第4行行与第5行记录是完全重复时,则不能达到查第5行的效果楼主你说要查一行记录: 若有主键的: select * from 表 where 条件
--示例
alter table tablename add recordID int identity(1,1)
godelete from tablename where recordID = xxx
go
如果我想读T_AREA表中的前两列:c_code,c_desc
将其读出写入到ls_code和ls_desc中
应该怎么样写呢?
TOP参数只能是读前面多少行!!
from table
where checksum(*) not in (select top 4 checksum(*) from table)
from table
用where 语句限制想要列的条件 语法格式
where 列名=想要的值
from table
用where 语句限制想要列的条件 语法格式
where 列名=想要的值
“
select top 1 *
from table5
where checksum(*) not in (select top 4 checksum(*) from table5) ”
这种查询方法,当第4行行与第5行记录是完全重复时,则不能达到查第5行的效果楼主你说要查一行记录:
若有主键的:
select * from 表 where 条件