Vim: Most efficient way to copy newline separated list in the middle of text to a comma separated list
By : Goot
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I have this text: , Visually select your block.
|
Compare items in comma separated list to another set of items in a comma separated list using limited Oracle SQL
By : Mark Maggio Giocondo
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further While I absolutely agree with commentators that the data model is flawed, sometimes you have to work with what you're given. If it is really impossible to change the data model then you can do this, but it isn't entirely pretty, and depends on your 'restrictions' not excluding the use of common table expressions - I've seen tools struggle with those... code :
with items_cte as (
select id, regexp_substr(items, '[^,]+', 1, level) as item, level as pos
from items
connect by level <= regexp_count(items, '[^,]+')
and prior id = id
and prior sys_guid() is not null
),
list_cte as (
select regexp_substr(:list, '[^,]+', 1, level) as item,
count(*) over () as list_length
from dual
connect by level <= regexp_count(:list, '[^,]+')
)
select i.id, listagg(i.item, ',') within group (order by i.pos) as items
from items_cte i
join list_cte l
on l.item = i.item
group by i.id
having count(distinct i.item) = max(l.list_length)
order by i.id;
ID ITEMS
---------- --------------------------------------------
1 ItemA,ItemB,ItemC
2 ItemC,ItemB,ItemA
3 ItemC,ItemA,ItemB,ItemB
|
Find comma separated value in a column by using comma separated list
By : Peter Bienek
Date : March 29 2020, 07:55 AM
wish of those help I have a a column item_id_list with comma separated id such as this: , You could use a OR with find_in_set code :
SELECT * FROM task_detail
WHERE FIND_IN_SET('21', item_id_list)
OR FIND_IN_SET('79', item_id_list)
|
Excel formula to check if items from a comma separated list in one cell exist in a comma separated list in another cell?
By : Klaire Attard
Date : March 29 2020, 07:55 AM
|
Filter rows by matching comma separated list against comma separated list
By : user5986990
Date : March 29 2020, 07:55 AM
Hope that helps I have the below table , You could simply use the LIKE operator, as follows : code :
SELECT *
FROM mytable
WHERE Col2 LIKE '%ABS%' OR Col2 LIKE '%MCM%'
SELECT *
FROM mytable t
WHERE EXISTS (
SELECT 1
FROM (SELECT val FROM STRING_SPLIT('ABS, MCM', ',')) x
WHERE CONCAT(',', t.Col1, ',')
LIKE CONCAT('%,', x.val, ',%')
)
|