Mysql-select查询数据

-- 查询所有列
-- select * from 表名
select * from student;

-- 指定条件查询
select * from student where id=4;

-- 查询指定列
-- select 列1,列2,…… from 表名
select name,high from student where gender="男";

-- 可以使用as为列或者表指定别名
select name as "名字",high as "身高" from student where gender="男";

-- 字段顺序
select high,name from student;

 

 

表取自:

Mysql-几张供于学习的表 - 夜黎i - 博客园 (cnblogs.com)

posted on 2023-02-01 11:17  夜黎i  阅读(24)  评论(0)    收藏  举报

导航