mysql查詢

 

 

1. 按名字查找

Select * from yuangong where name=’’;

2. 按薪水大於1000查找

Select * from yuangong where salary>1000;

3. 部門人數

Select  dept_id,count(*) as total from yuangong group by dept_id;

4. 部門平均薪資

Select dept_id,avg(salary) from yuangong group by dept_id;

5. 描述爲空的

Select * from yuangong where description is null;

6. 每個部門女員工薪水最大值

Select dept_id,max(salary) from yuangong where gende='f' group by dept_id having ;

7. 名字以l開頭的

Select * from yuangong where name like ‘l%’;

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章