为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:
【操作系统】:
【CPU】:
【问题描述】*:with a as
(select rownum id,
regexp_substr( ' 阴离子合成洗涤剂 , 臭氧 , 石油类 , 氰化物 ' , '[^,]+', 1, LEVEL) as "name"
from dual
CONNECT BY LEVEL <= LENGTH( ' 阴离子合成洗涤剂 , 臭氧 , 石油类 , 氰化物 ' )-LENGTH(REPLACE( ' 阴离子合成洗涤剂 , 臭氧 , 石油类 , 氰化物 ' , ','))+ 1
)
,
b as
(select rownum id,
regexp_substr( ' GB/T 5750.11-2006 , GB/T 5750.5-2006 , GB/T 5750.7-2006 , GB/T 5750.4-2006 ' , '[^,]+', 1, LEVEL) as testAccording
from dual
CONNECT BY LEVEL <= LENGTH( ' GB/T 5750.11-2006 , GB/T 5750.5-2006 , GB/T 5750.7-2006 , GB/T 5750.4-2006 ' )-LENGTH(REPLACE( ' GB/T 5750.11-2006 , GB/T 5750.5-2006 , GB/T 5750.7-2006 , GB/T 5750.4-2006 ' , ','))+ 1
)
,
c as
( select name,testAccording from a join b on a.id = b.id
)
,
d as
(select listagg(name,'#')within group (order by name) itemNames,
listagg(testAccording,'#') within group (order by testAccording) testAccordings
from c
)
,
e as
( select listagg(distinct i.name,'#')within group (order by i.name) itemNames,
listagg(distinct i.test_according ,'#')within group (order by i.test_according :: varchar) testAccordings,
s.preservation_method,
s.sample_pack,
s.ctime
from dev_lims.env_item i
join dev_lims.env_sample s
on s.id = i.sample_id
and s.deleted = 0
where i.deleted = 0
and i.company_id= 1381799962721665026
and s.preservation_method is not null
and s.sample_pack is not null
group by sample_id,
s.ctime,
s.preservation_method,
s.sample_pack
)
select preservation_method,
sample_pack
from e
join d
on d.itemNames = e.itemNames
and d.testAccordings = e.testAccordings
order by e.ctime desc limit 1
参数绑定没对应正确吧