Tim123: MySQL: Kette von "OR" in WHERE Klausel vermeiden

Hallo,
ich möchte aus einer MySQL-Tabelle 25 Einträge auswählen mit jeweils einer bestimmten id. Dafür müsste man theoretisch ... WHERE id='5' OR id='45' OR id= ... schreiben.

Gibt es eine einfachere und effizientere Möglichkeit? Ich würde gerne 25 "OR" vermeiden.

Grüße
Tim

  1. Hi!

    ich möchte aus einer MySQL-Tabelle 25 Einträge auswählen mit jeweils einer bestimmten id. Dafür müsste man theoretisch ... WHERE id='5' OR id='45' OR id= ... schreiben.

    Oder Du schreibst: SELECT bla, blubb, ... FROM tabelle WHERE id IN (5,45,...)

    off:PP

    --
    "You know that place between sleep and awake, the place where you can still remember dreaming?" (Tinkerbell)
    1. Danke so etwas habe ich gesucht!

      1. Hi,

        Danke so etwas habe ich gesucht!

        Wo denn bitte - im Handbuch aber wohl nicht, denn da haettest du es doch finden muessen ...?

        MfG ChrisB

        --
        "The Internet: Technological marvel of marvels - but if you don't know *what* you're lookin' for on the Internet, it is nothing but a time-sucking vortex from hell."