a.JLDate为非标准日期格式: 例: 2011-8-28 0:00:000011-8-28 0:00:000111-8-4 0:00:00 select CONVERT(varchar(50),CONVERT(datetime, a.JLDate, 120),120) as JLDate,b.ch,b.bh,cast((cast(b.mz as decimal(18,6))/1000) as decimal(18,6)) as mz,a.ExeCode as zzdmfrom oil_JLH
前段时间遇到一个存储过程,参数之一是一个字符串,在存储过程中,把字符串拆分成一个临时表之后存为一个key值的临时表,作为其中一个查询条件, 逻辑实现上有两种处理方式 insert into #t select key from split_function('传递进来的字符串',',') 第一种是与物理表做inner join,类似如下 select * from tableA a inner join tableB b on a.id = b.id inner join #t c on b.k