MySQL Abfrage auf nicht LIKE
Lulinda
- datenbank
Hallo,
ich möchte aus einer Tabelle alle Datensätze erhalten, deren Feld "position" NICHT mit einem bestimmten Buchstaben beginnt.
Wie also kann man folgende Abfrage "verneinen"??:
SELECT * FROM tabelle WHERE position LIKE 'K%' OR position LIKE 'L%';
Danke für jede Hilfe,
Lulinda.
Hallo,
Hallo,
Wie also kann man folgende Abfrage "verneinen"??:
SELECT * FROM tabelle WHERE position LIKE 'K%' OR position LIKE 'L%';
Also bei MS-SQL würde ich
SELECT * FROM tabelle WHERE position NOT LIKE 'K%' OR position NOT LIKE 'L%';
verwenden.
Grüße
Uhfe
Hello,
Wie also kann man folgende Abfrage "verneinen"??:
SELECT * FROM tabelle WHERE position LIKE 'K%' OR position LIKE 'L%';
Also bei MS-SQL würde ich
SELECT * FROM tabelle WHERE position NOT LIKE 'K%' OR position NOT LIKE 'L%';
Nö, nö. Das ist nicht richtig.
SELECT * FROM tabelle WHERE not( position LIKE 'K%' OR position LIKE 'L%');
ergibt ausgeschrieben
SELECT * FROM tabelle WHERE position NOT LIKE 'K%' AND position NOT LIKE 'L%');
Harzliche Grüße aus http://www.annerschbarrich.de
Tom