插入排序的问题
leneq 2003-08-19 05:21:06 一般在select * ,identity(int,1,1) as xh from 表 order by 需要排序的字段
这样生成的序号没有没有问题
可当联合表的时候
select *,identity(int,1,1) as xh from 表1 join 表2 on(条件) order by 需要排序的字段
这样生成的序号根本就没有按照order by的字段来排序
在微软的新闻组上问了这样的问题
有人回答这样解决
select *,identity(int,1,1) as xh from (select 字段 from 表1 join 表2)
as 表名 order by 需要排序的字段
我试了一下,也不行
在这里提出来,大家讨论一下好不好?