1.查询某个表的所有数据
select * from 表名
2.查询某个表的指定列数据
select 列名1,列名2 from 表名
3.查询指定行的数据
select * from 表名 where 列名=\"条件\"
4.查询指定行,某几列的数据
查询列名1为条件1,并且列名2为条件2的数据
select 列名1,列名2 from 表名 where 列名1 = \"条件1\" and 列名2 = \"条件2\"
查询列名1为条件1,或列名2为条件2的数据
select 列名1,列名2 from 表名 where 列名1 = \"条件1\" or 列名2 = \"条件2\"
查询列名1为条件1,并且列名2不等于条件2的数据
select 列名1,列名2 from 表名 where 列名1 = \"条件1\" not 列名2 = \"条件2\"
5.查询某个表数据,根据城市ID顺序排列、账号倒序排列
select * from 表名 order by city_id asc, account desc
6.查询成绩表中,有哪些学生
select DISTINCT student_id from 表名
7.查询表中哪些行 为null
查询列名1为空的行
select * from 表名 列名1 is null
查询列名1不为空的行
select * from 表名 列名1 is not null
继续阅读与本文标签相同的文章
下一篇 :
在线文字识别软件怎么用?
-
最佳 Linux 发行版汇总
2026-05-18栏目: 教程
-
StartDT AI Lab | 视觉智能引擎——AI识货赋能商品数字化
2026-05-18栏目: 教程
-
【DockerCon2017技术解读】如何在阿里云一键部署高可用的Kubernetes集群
2026-05-18栏目: 教程
-
基于Jenkins的开发测试全流程持续集成实践
2026-05-18栏目: 教程
-
什么是网络爬虫?有什么用?怎么爬?终于有人讲明白了
2026-05-18栏目: 教程
