39. 拼接表字段b.day

Posted zkx4213

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了39. 拼接表字段b.day相关的知识,希望对你有一定的参考价值。

var fun = ABS_LOADBEAN("com.plug.FunctionHelper");
//var v_div = fun.funHelper.strAdd("‘<div>‘","b.Day");
//v_div = fun.funHelper.strAdd(v_div,"‘</div>‘");
var v_div = "‘<div>‘||"+"b.Day"+"||‘</div>‘";
var sql = " select max(ID) ID,NoofWeek,max(Week1) Week1,max(Week2) Week2,max(Week3) Week3,max(Week4) Week4,max(Week5) Week5,max(Week6) Week6,max(Week7) Week7 "
+" from ( "
+" select a.ID,to_number(to_char(b.Year)||(CASE WHEN b.NoofWeek>=10 THEN to_char(b.NoofWeek) ELSE ‘0‘||to_char(b.NoofWeek) END)) as NoofWeek,"
+" case when b.Week=1 then "+v_div+" else ‘‘ end as Week1,"
+" case when b.Week=2 then "+v_div+" else ‘‘ end as Week2,"
+" case when b.Week=3 then "+v_div+" else ‘‘ end as Week3,"
+" case when b.Week=4 then "+v_div+" else ‘‘ end as Week4,"
+" case when b.Week=5 then "+v_div+" else ‘‘ end as Week5,"
+" case when b.Week=6 then "+v_div+" else ‘‘ end as Week6,"
+" case when b.Week=7 then "+v_div+" else ‘‘ end as Week7 "
+" from T_HR_WorkCalendar a,tCalendar b"
+" where a.FAttendPeriod={0} and a.FWorkType={1} and to_char(a.FWorkDate,‘yyyyMMdd‘)=b.ID and funit = {2}"
+" ) x"
+" group by NoofWeek"
+" order by Noofweek";
sql

以上是关于39. 拼接表字段b.day的主要内容,如果未能解决你的问题,请参考以下文章

1、sql查询语句时怎么把几个字段拼接成一个字段?这几个字段是整型的。

oracle sql字段值拼接问题

c#字符串中拼接参数该处理的问题

SQL server查看用户表的所有字段信息

sql 语句,查询条件,两个字段拼接和一个串比较怎从实现呢?sql 语句怎么写!谢谢!

MSSQL 中如何判断两个表的所有数据是不是相同(两个表的字段已经相同)