开发者

MySQL exclude row

开发者 https://www.devze.com 2023-02-01 19:53 出处:网络
SELECT id,x,y FROM `chars开发者_如何学编程` WHERE `mapa`=\'1\' how can i exclude row when id=\'3\'SELECT id,x,y FROM `chars` WHERE `mapa`=\'1\' and id <> \'3\'
SELECT id,x,y FROM `chars开发者_如何学编程` WHERE `mapa`='1'

how can i exclude row when id='3'


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.


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

精彩评论

暂无评论...
验证码 换一张
取 消