问题原由: intouch项目中,利用intouch脚本来存储数据时,存入的时间格式为:date,time分开存储.在报表需求中,有需要利用查询两个时间段之间的数据. 问题解决: 1.直接写脚本(写出的脚本有bug) 表结构如下: select * from 在线数据日报表 where(convert(char(10),date,120)>='2018-10-30' and time>='18:00:00') and (convert(char(10),date,120)<='2018-…
关于和并列的 要这种效果. create table tb(idint, value varchar(10)) insert into tbvalues(1,'aa') insert into tbvalues(1,'bb') insert into tbvalues(2,'aaa') insert into tbvalues(2,'bbb') insert into tbvalues(2,'ccc') go /* stuff(param1, startIndex, length…
select a + ' '+b as ab from tableName 如果是有整型的(例,b字段为int类型): select a +' '+Convert(VARCHAR(50),b) as ab from tableName 如果是有小数的(例,b字段为float类型) select a +' '+convert(varchar(20),convert(decimal(18,4),b)) as ab from tableName 注释:a,b为列名…