MySQL excludes row

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

how can i exclude the string when id = '3'

+3
source share
2 answers
SELECT id,x,y FROM `chars` WHERE `mapa`='1' and id <> '3'

What is a data type id? If the numeric value you would like to use

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

In MySQL, you can also use !=, not <>, but <>- ANSI and more portable .

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

Source: https://habr.com/ru/post/1782993/


All Articles