company logo
advertisement for deep fried Twinkies


数据库操作


 

查询:简单功能

查询年龄等于23的人

select * from T_Employee where FAge=23

--年龄在20到25之间的员工信息


select * from T_Employee where FAge>20 and FAge<25 
  

--年龄在20到25之间的员工信息,包含25


select * from T_Employee where FAge between 20 and 25

--查询T_Employee表中数据条数


select COUNT(*) from T_Employee

 数据排序

--按年龄排序升序,默认是升序  ASC从小到大 DESC从大到小


select * from T_Employee order by FAge ASC

--多个条件排序,先什么,后什么,在前一个条件相同的情况下,根据后一个条件进行排列 

--where在order by之前


select * from T_Employee order by FAge ASC, FSalary DESC