Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT *
- FROM freelook
- WHERE done_type IN ('14','27','28')
- ...
- WHERE
- done_type = '14'
- OR done_type LIKE '14,%'
- OR done_type LIKE '%,14'
- OR done_type LIKE '%,14,%'
- SELECT *
- FROM freelook
- WHERE done_type LiKE '%14%'
- OR done_type LiKE '%27%'
- OR done_type LiKE '%28%'
- SELECT *
- FROM freelook
- WHERE REGEXP_LIKE(done_type, '[^14,|,14,|,14$|^27,|,27,|,27$|^28,|,28,|,28$|]')
- SELECT *
- FROM freelook
- WHERE REGEXP_LIKE(done_type, '^14,27,28$')
- WITH tokens as (
- SELECT distinct id, token
- FROM
- (SELECT
- id,
- SUBSTR (csv,
- INSTR (csv, ',', 1, LEVEL ) + 1,
- INSTR (csv, ',', 1, LEVEL+1) - INSTR (csv, ',', 1, LEVEL) -1
- ) AS token
- FROM (
- SELECT id, ','||trim(done_type||',') csv FROM freelook)
- CONNECT BY LEVEL <= LENGTH(csv)-LENGTH(REPLACE(csv,',',''))+1)
- WHERE token is not NULL)
- SELECT id FROM tokens
- WHERE token in ('14','27','28')
- ORDER BY id, token
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement