Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL exclude row

Tags:

mysql

SELECT id,x,y FROM `chars` WHERE `mapa`='1'

how can i exclude row when id='3'

like image 713
Ghandhikus Avatar asked Dec 08 '25 20:12

Ghandhikus


2 Answers

SELECT id,x,y FROM `chars` WHERE `mapa`='1' and id <> '3'

What is the data type of id though? If numeric you would want to use

SELECT id,x,y FROM `chars` WHERE `mapa`='1' and id <> 3

In MySQL you can also use != rather than <> but <> is ANSI and more portable.

like image 158
Martin Smith Avatar answered Dec 10 '25 11:12

Martin Smith


SELECT id,x,y FROM `chars` WHERE `mapa`='1' AND `id`<>3

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!