【黄啊码】MySQL入门—6、掌握这些数据筛选技能比你学python还有用-2

大家好!我是黄啊码,上节课我们将了DISTINCT、 FROM 、 GROUP BY、 HAVING 、 ORDER BY 这些筛选数据的技能,是不是总感觉少了些啥?

你:啊码,你把最重要的where给漏了!

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:50448a51-0845-460b-9db7-59203eabb124

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:5640cbb1-acf0-4006-9ef6-fdf6d72408a6

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:2e349158-c57b-4d9f-a08d-027e31f830ee

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:96679cfa-f573-49aa-839e-c692f9b74b45

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:3b964654-a3c0-4f91-83b2-8b79a0d7a124

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:33372e50-11b4-4ce2-8d38-f9d842f6c070

好了,进入正题吧:WHERE 子句,说起来 SQL 其实很简单,只要能把满足条件的内容筛选出来即可,但在实际使用过程中,不同人写出来的 WHERE 子句存在很大差别,比如执行效率的高低,有没有遇到莫名的报错等。

这是今天的

目录

学会使用 WHERE 子句,如何使用比较运算符对字段的数值进行比较筛选;

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:5b8ec0c5-8944-4e7f-b805-c93a3c1f1e7e

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:91fa2107-27ac-42c9-b393-a7d56a27cdce

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:692c5eab-6df4-4574-bf1d-757a2b77fa6b

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:c57cbbdc-5480-46b3-af34-651124e2e1ca

学会使用 WHERE 子句,如何使用比较运算符对字段的数值进行比较筛选;

比较运算符
在 SQL 中,我们可以使用 WHERE 子句对条件进行筛选,在此之前,你需要了解 WHERE 子句中的比较运算符。这些比较运算符的含义你可以参见下面这张表格:

【黄啊码】MySQL入门—6、掌握这些数据筛选技能比你学python还有用-2

啊码贴出的这图只是常用数据库的运算符,建议别直接copy就用。

你:为啥?作为老师,不应该是直接给准确答案吗?

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:0b3c433f-790e-4da4-8e67-36db38f8c7b8

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:e56778be-78fe-4de5-82e9-60fc2e38cba4

你:我只见过》答:略。

黄啊码:。。。

注:你需要查看使用的 DBMS 是否支持,不同的 DBMS 支持的运算符可能是不同的,比如 Access 不支持(!=),不等于应该使用(<>)。在 MySQL 中,不支持(!>)(!

Original: https://www.cnblogs.com/huangama/p/16506728.html
Author: 黄啊码
Title: 【黄啊码】MySQL入门—6、掌握这些数据筛选技能比你学python还有用-2

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/562251/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球