MySQL排除行

问题描述:

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

当id ='3'时我如何排除行

how can i exclude row when id='3'

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

id的数据类型是什么?如果是数字,则要使用

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

在MySQL中,您也可以使用!=而不是<>,但是<>是ANSI

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