SQL语句(select)

select id as 学号 from table  :在之后的显示中,将id改为学号。 as可以省略不写

select * from table 查所有

select distinct id from table 查询有重复内容时,避免重复

select id from table where 学院=“计算机”或者age>20或者age between 20 and 23 等等     有条件的查询

select * from table order by age 查询结果按升序排列

select * from table order by age  desc  查询结果按降序排列

 

posted @ 2022-03-13 21:07  菜鸟是如何练成的  阅读(545)  评论(0)    收藏  举报