SQL语句转化成sqlserver

                  String sql= "select concat(CAST(year(OUT_DT) as CHAR),'年') timebucket,year(OUT_DT)*10000 a ,count(*) renshu,OUT_MAIN_DIAG_INSTAT leibie,concat(CAST(min(OUT_DT) as CHAR),':',CAST(max(OUT_DT) as CHAR)) beginandendtime from WORK_BASY_DATA where OUT_DT >= '"+start_date+"' and  OUT_DT <='"+end_date+"' "+sb.toString()+" group by timebucket ,OUT_MAIN_DIAG_INSTAT having OUT_MAIN_DIAG_INSTAT!='' and OUT_MAIN_DIAG_INSTAT!='NA' ORDER BY a ASC ";
查看全部
qq_31071631
qq_31071631
2016/02/16 03:02
  • sql
  • 点赞
  • 收藏
  • 回答
    私信

2个回复