can I use: separation by a comma to compare the values with another table

Hi ALL, I am using oracle 10g, can someone help me with this query
WITH t AS
     (SELECT 20 ID, 'ABC,DEF,GHI' VALUE
        FROM DUAL),
     x AS
     (SELECT 20 ID, 'ABC' VALUE
        FROM DUAL
      UNION ALL
      SELECT 20, 'DEF'
        FROM DUAL
      UNION ALL
      SELECT 20, 'GHI'
        FROM DUAL)
SELECT x.ID, x.VALUE
  FROM x, t
 WHERE x.VALUE IN (t.value);

o/p required
-------------------
20  ABC
20  DEF
20 GHI
I know I can't use t.valeur in TO would adopt. so I tried to use it in the paragraph, but it did not work.
''''|| Replace (T.valeur, ",", "", "') |" '

Published by: DeepakDevarapalli on December 15, 2009 19:27

Hello

Here's a way to do it:

SELECT      x.ID
,      x.VALUE
FROM      x
JOIN     t     ON      ',' || t.value || ','
          LIKE     '%,' || x.value || ',%'
;

Extra commas are necessary to avoid the problem of 'mother is in chemotherapy,' when a single value can be one substring of another. If this is impossible (as in your case, where all values are exactly 3 characters) then you don't have them.

Tags: Database

Similar Questions

Maybe you are looking for

  • There was a problem loading of files that can be restored

    Hello. I am currently using OSSierra and 10 for my iPhone and iPad iOS. I activated this thing where you save your desktop stuff on your iCloud then accidentally deleted. I tried to restore them in iCloud restoration but it goes on to say: "there was

  • 5s - no response from some contacts IPhone

    Bought Iphone 5s last week - all contacts have been transferred, but I'm no longer receive texts or emails from certain contacts. No idea why?

  • 'pirates' url

    I enter the url www.delta.com and I am instantly redirected to Xfinity.com. I cannot go into Delta on Chrome, but not on Safari. Somehow, the address Delta.com was 'hijacked' on Safari. How to cancel it?

  • PCL XL error

    Hello I have a printer hp laserjet 2015. It was working fine and I printed two pages, after he didn't print more and the triangle exclamation light began to pulse. After that a book came out saying: PCL XL error Error: InsufficientMemory Operator: Se

  • Properties of a PDF document will not be displayed

    In Windows Explorer when I click on properties of document in the drop-down list to a file, ALL my PDF files lack the document properties.  I deleted and re-installed my Adobe Acrobat 8 Standard, but the properties are still reported missing.  Adobe