mysql篇第九课:查询语句(二)

  这节课继续学查询语句

 

  排序查询:

 

语法:

select

         要查询的东西

from

         表

where

         条件

 

order by 排序的字段|表达式|函数|别名 【asc|desc】

 

演示一下:

 

Demo 01:

-- 根据部门id排序查询所有员工

select * from tbl_employee ORDER BY d_id asc;

 

结果:

 

asc是升序,desc是降序

 

 

猜你喜欢

转载自blog.csdn.net/qq_40061421/article/details/84400275