哈希空间

mysql查询表数据

查询表数据 SELECT

语法

SELECT1,列2,... FROM 表名称

或 全部列 *

SELECT * FROM 表名称

例子

select * from student

或使用 `` 将表名和字段名标注起来,防止触发MySQL关键词。

select * from `student`

where 查询条件

查找 姓名 name 等于 Jack 的记录

select * from `student` where name='Jack'

结果:

id name birthday height
1 Jack 1990-01-01 180

几种查询例子:

查找 身高大于等于 170 的记录

select * from `student` where height >=170

and 查询

查找 姓名 name 等于 Jack 身高大于等于 170 的记录

select * from `student` where name='Jack' and height >=170

or 查询

查找 姓名 name 等于 Jack 身高大于等于 170 的记录

select * from `student` where name='Jack' or height >=170

null 记录查询

查找 手机号 mobile 为空 的记录

select * from `student` where mobile is null

本文 最佳观看地址:https://www.hashspace.cn/mysql-chaxunbiaoshuju.html 阅读 495

打开 哈希空间 微信小程序中查看更佳