我的数据库中有
0000-0000-0000-1026262
0000-0000-0000-1026263
0000-0000-0000-1026264
0000-0000-0000-1026265
0000-0000-0000-1026266
0000-0000-0000-1026267
0000-0000-0000-1026268
0000-0000-0000-1026269
0000-0000-0000-1026270
0000-0000-0000-1026271
0000-0000-0000-1026274
0000-0000-0000-10262 ......
SQL code:
if object_id('tb') is not null
drop table tb
create table tb(type varchar(20),accessoryNo varchar(20),deviceNo varchar(10),lastTime decimal(27,6))
insert tb
select 'A','s10','z11',10 union all
select 'B','s10','z11',11 union all
select 'A','s11','z12', ......
如何用sql语句查询出最新日期所在列的所有数据呢?
用order by就可以实现
order by 日期 desc
top 1 + order by
SQL code:
select * from t_data where f_date =(select max(f_date) from t_data)
order by
楼主,把表结构发出来啊!
select * from 表名 order by 日期字段 desc
select top 1,* ......
假如我有数据
Reguon User_name Amount
东区 张三 6834.4
东区 张果 5000
东区 张曼玉 2000
北区 李玉 1250
北区 李四 1505.9
北区 王五 572.3
南区 钱一 3417.2
怎么用SQL实现分区排序
Reguon User_name Amount Sequence
东区 张三 6834.4 1
东区 张果 5000 2
东区 张曼玉 2000 3
北区 李玉 12500 1 ......
各位大侠:
麻烦帮我看下这个sql语句怎么写
文章表:
ID, bt, nr,catid,zhuantiid(专题)
专题表:
zid,name
由于文章表中的 zhuantiid(专题) 中可能会对应多个专题,多个专题之间用,逗号隔开。 如:1,3,4,11,12,13
当我按各专题来读取文章时。我的sql语句能这么写吗?
如:读取 专题 ......
RT
SQL code:
select * from sysfiles
SQL code:
select filename from sysfiles
邮件->属性->查找目标。勿见笑
SQL code:
use master
select * from sysfiles
看看就差不多了
从注册表应该是准确的,从数据库里查出的与数据库安装路径有关
引用
SQL code
select filename from sysfiles
......