MySQL排除行 [英] MySQL exclude row

查看:96
本文介绍了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.

这篇关于MySQL排除行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆