求sql语句

[复制链接]
查看11 | 回复1 | 2007-10-20 08:38:44 | 显示全部楼层 |阅读模式
以a表中 a.BianHao前10 条记录作为b表的一列b.BianHao1,10-20条记录为b的另外一列b.BianHao2.......怎么写查询语句生成b表
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
insert into b(bianhao1) from select top 10 bianhao from a order by bianhao
insert into b(bianhao2) from select top 10 bianhao from (select top 20 bianhao from a order by bianhao)ccc order by bianhao desc
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行