Announcement

Collapse
No announcement yet.

SELECT verkürzbar?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SELECT verkürzbar?

    Hallo allerseits,
    und wieder eine Frage für Anfänger...

    Kann man das hier irgendwie kürzer fassen, wenn das innere SELECT immer das gleiche ist?
    Code:
    SELECT field FROM table
    WHERE a = Inneres Select OR b = Inneres Select OR c = Inneres Select
    Vielen Dank und Gruß,
    Tom

  • #2
    SELECT field FROM table
    WHERE Inneres Select in (a,b,c)
    docendo discimus

    Comment


    • #3
      Danke.
      Funktioniert das Ganze auch mit LIKE?

      also, diesmal ausführlich...
      SELECT field from table
      WHERE a LIKE CONCAT("%",Inneres Select,"%")
      OR b LIKE CONCAT("%",Inneres Select,"%")
      OR c LIKE CONCAT("%",Inneres Select,"%")

      Das scheint mit dem "IN" nicht zu funktionieren.

      Gruß,
      Tom

      Comment

      Working...
      X