用sql语句等分数据表中每列相邻值并存储
时间:2011-11-10
来源:互联网
请高手赐教,谢谢!
有NO表,把NO表中NUM0、NUM1、NUM2列的前后两个数据五等分得到NO’表。例如:
NO表
NUM0 NUM1 NUM2
50 10 300
100 15 200
150 5 260
… … …
NO’表
NUM0 NUM1 NUM2
50 10 300
60 11 280
70 12 260
80 13 240
90 14 220
100 15 200
110 13 212
120 11 224
130 9 236
140 7 248
150 5 260
… … …
有NO表,把NO表中NUM0、NUM1、NUM2列的前后两个数据五等分得到NO’表。例如:
NO表
NUM0 NUM1 NUM2
50 10 300
100 15 200
150 5 260
… … …
NO’表
NUM0 NUM1 NUM2
50 10 300
60 11 280
70 12 260
80 13 240
90 14 220
100 15 200
110 13 212
120 11 224
130 9 236
140 7 248
150 5 260
… … …
作者: sxldxx 发布时间: 2011-11-10
这是等分么?
SQL code
SQL code
create table tb(NUM0 int,NUM1 int,NUM2 int) insert into tb select 50,10,300 insert into tb select 100,15,200 insert into tb select 150,5,260 go select a.num0+10*b.number num0,a.num1,a.num2-10*b.number num2 from tb a,master..spt_values b where b.type='p' and b.number between 1 and 5 /* num0 num1 num2 ----------- ----------- ----------- 60 10 290 70 10 280 80 10 270 90 10 260 100 10 250 110 15 190 120 15 180 130 15 170 140 15 160 150 15 150 160 5 250 170 5 240 180 5 230 190 5 220 200 5 210 (15 行受影响) */ go drop table tb
作者: qianjin036a 发布时间: 2011-11-10
SQL code
create table tb(NUM0 int,NUM1 int,NUM2 int) insert into tb select 50,10,300 insert into tb select 100,15,200 insert into tb select 150,5,260 go select a.num0+10*b.number num0,a.num1+b.number num1,a.num2-10*b.number num2 from tb a,master..spt_values b where b.type='p' and b.number between 1 and 5 /* num0 num1 num2 ----------- ----------- ----------- 60 11 290 70 12 280 80 13 270 90 14 260 100 15 250 110 16 190 120 17 180 130 18 170 140 19 160 150 20 150 160 6 250 170 7 240 180 8 230 190 9 220 200 10 210 (15 行受影响) */ go drop table tb
作者: qianjin036a 发布时间: 2011-11-10
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28