Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL: FELD1 beinhaltet FELD2

Empfohlene Antworten

Veröffentlicht

Hi,

ich hab bei einer Abfrage auf eine Oracle DB das Problem, dass in 2 Feldern gleiche Teilstrings enthalten sein können.

Beispiel:

Feld1 = "Maria"

Feld2 = "u. Maria"

Ich möchte also abfragen, welcher Satz den Wert aus Feld1 auch in Feld2 stehen hat, bekomme das aber mit dem Wildcard nicht hin:

select ROW from TABLE a where FELD2 like '%(select FELD1 from TABLE b where a.ROW = b.ROW)';

Jemand ne Idee?

Danke für die Hilfe!

Geht ein simples "WHERE Feld2 like '%' + Feld1 + '%'" nicht?

Hi,

Ich möchte also abfragen, welcher Satz den Wert aus Feld1 auch in Feld2 stehen hat, bekomme das aber mit dem Wildcard nicht hin:

Danke für die Hilfe!

Hallo,

Du kannst dies mit REGEXP lösen. Mal ein Beispiel für die Suche :


SELECT CASE

           WHEN REGEXP_LIKE (Feld2,  Feld1,'c')

           THEN

               'Match Found'

           ELSE

               'No Match Found'

       END

           AS output

  FROM MyTable;


Hinweis : Der Parameter 'c' steht für CaseSensitive, alternativ wäre auch ein 'i' (CaseInsensitive) möglich

Gruss

Bearbeitet von dbwizard

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.