tableA : g_supply_info
column: product_unit: (1,2,3)
将str去掉()
sql:
<pre name="code" class="sql">
update bemms.g_supply_info si set si.product_unit=replace(replace(si.product_unit ,'('),')')
一行数据 id product_category
10001 1,2,3
拆分为 id product_category
10001 1
10001 2
10001 3
sql:
SELECT DISTINCT regexp_substr(category, '[^,]+', 1, level) category,
id
FROM (SELECT id, product_category category
FROM g_contract_info)
CONNECT BY LEVEL <= LENGTH(category) -
LENGTH(REPLACE(category, ',', '')) + 1
查询a是否在abc中
sql:
select instr('abc','a') from dual