SQL实现多个数据返回值拼接

展开阅读全文

多个单独SQL语句的运算拼接

09-29

我是计算某一个时段内的累计雨量,比如2009-08-05 08:10 至 2009-08-06 20:20 之间的整点雨量和,第一个SQL是:strS1= select StationID AS 站点编号,StationName As 站点名称,Longitude AS 经度, Latitude AS 纬度,Replace(Rain,'-65535','') As 整点雨量 from QX_SglMediumSmallScale where DateChar='2009-08-05' and TimeChar='0810' group by Rain,StationID,StationName,Longitude,Latitude order by StationID,整点雨量rnrn第二个是:strS2 = select StationID AS 站点编号,StationName As 站点名称,Longitude AS 经度, Latitude AS 纬度,Replace(Rain,'-65535','') As 整点雨量 from QX_SglMediumSmallScale where DateChar='2009-08-05' and TimeChar='0900' group by Rain,StationID,StationName,Longitude,Latitude order by StationID,整点雨量rnrn第三段是:strS3= select StationID AS 站点编号,StationName As 站点名称,Longitude AS 经度, Latitude AS 纬度,cast(SUM(Rain) as decimal(10,1)) As 整点雨量 from QX_SglMediumSmallScale where ((DateChar='2009-08-05'and TimeChar>'0900') or(DateChar>'2009-08-05')) and ((DateChar='2009-08-06' and TimeChar<='2020') or(DateChar<'2009-08-06')) and TimeChar like '%%00' group by StationID,StationName,Longitude,Latitude order by StationID,整点雨量rnrn第四段是:strS4= select StationID AS 站点编号,StationName As 站点名称,Longitude AS 经度, Latitude AS 纬度,Replace(Rain,'-65535','') As 整点雨量 from QX_SglMediumSmallScale where DateChar='2009-08-06' and TimeChar='2020' group by Rain,StationID,StationName,Longitude,Latitude order by StationID,整点雨量rnrn首先要用(strS2-strS1)取出2009-08-05 08:10 到2009-08-05 09:00之间的雨量累计,rn 然后是用(strS2-strS1)这部分与strS3 、strS4 三部分相加,计算出每个站点对应的雨量值,rn 我用的是泛型数组存储的方法,但是有时候其中的一段SQL查询为空时就会出现问题,就这个问题,请教一下,还有什么好的解决方法,帮小弟一下!感激不尽 论坛

拼接多个输出

05-25

<div>n <span style="font-size:16px;"><span><span style="font-size:20px;color:#FF0000;"><strong><span>课程亮点:</span></strong></span></span></span> n</div>n<div style="font-size:16px;">n <span style="color:#424242;"><span style="background-color:#FFFAA5;">笔记加案例详细讲解Linux知识!!!提供详细的笔记作为辅助工具,<span style="color:#41AD1C;">200多条笔记帮助学员快速掌握Linux150多个知识点</span></span></span> n</div>n<p style="font-size:16px;">n <span style="font-size:14px;"><span><span style="background-color:#FFFFFF;"><span style="color:#424242;"><br /></span></span></span></span> n</p>n<p>n </p><p>n <span style="font-size:16px;"><span><strong><span style="background-color:#FFFFFF;">课程内容:</span></strong></span></span>n </p>nn<p style="font-size:16px;">n </p><ol><li>n <span style="color:#E53333;">第1章:Linux命令行概述:系统级别命令、文件和目录操作</span>n </li>n <li>n <span style="color:#E53333;">第2章: 重定向:标准输入输出重定向到文件、管理、过滤器</span>n </li>n <li>n <span style="color:#E53333;">第3章: echo命令:单个字符展开、特殊符号展开、集合展开、算术运算符展开、变量名展开、系统命令展开等</span>n </li>n </ol><div>n <span style="font-size:16px;"><span><span style="color:#FF0000;"><strong><span style="font-size:18px;">课程特色:</span></strong></span></span></span> n</div>n<ol><li>n <div>n 笔记Linux命令:用200条笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力n </div>n </li>n <li>n <div>n 笔记标题采用关键字标识法,帮助学员更加容易记住知识点n </div>n </li>n <li>n <div>n 笔记以超链接形式让知识点关联起来,形式知识体系n </div>n </li>n <li>n <p>n 采用先概念后实例再应用方式,知识点深入浅出n </p>n </li>n <li>n <div>n <span style="color:#00B050;"><strong>提供授课内容笔记作为课后复习以及工作备查工具</strong></span> n </div>n </li>n</ol><p>n <span style="font-size:16px;"><span><span style="color:#00B050;"><strong><strong><span style="font-size:18px;">部分图标(电脑PC端查看):</span></strong></strong></span></span></span> n</p>n<p>n <span style="font-size:16px;"><span><span style="color:#00B050;"><strong><strong><span style="font-size:18px;"><img src="https://img-bss.csdn.net/201905251409161851.png" alt="" /><img src="https://img-bss.csdn.net/201905251409239629.png" alt="" /><img src="https://img-bss.csdn.net/201905251409307966.png" alt="" /><img src="https://img-bss.csdn.net/201905251409365376.png" alt="" /><img src="https://img-bss.csdn.net/201905251409424735.png" alt="" /><br /></span></strong></strong></span></span></span> n</p>

没有更多推荐了,返回首页