中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

騰訊云服務(wù)器可以做傳奇網(wǎng)站嗎我想在百度上做廣告怎么做

騰訊云服務(wù)器可以做傳奇網(wǎng)站嗎,我想在百度上做廣告怎么做,棗莊高端網(wǎng)站建設(shè),雞西制作網(wǎng)站where、from、exists子查詢、分頁查詢 1 where子查詢1.1 where后面的標(biāo)量子查詢1.1.1 having后的標(biāo)量子查詢 1.2 where后面的列子查詢1.3 where后面的行子查詢(了解即可) 2 from子查詢3 exists子查詢(相關(guān)子查詢)4 分頁查詢5 聯(lián)合…

where、from、exists子查詢、分頁查詢

  • 1 where子查詢
    • 1.1 where后面的標(biāo)量子查詢
      • 1.1.1 having后的標(biāo)量子查詢
    • 1.2 where后面的列子查詢
    • 1.3 where后面的行子查詢(了解即可)
  • 2 from子查詢
  • 3 exists子查詢(相關(guān)子查詢)
  • 4 分頁查詢
  • 5 聯(lián)合查詢
  • 6 練習(xí)

1 where子查詢

1.1 where后面的標(biāo)量子查詢

1.誰的工資比Abel高?

select *
from employees
where salary > (select salaryfrom employeeswhere last_name = 'Abel'
);

2.返回job_id與141號(hào)員工相同,salary比143號(hào)員工多的員工姓名,job_id 和工資

select last_name,job_id,salary
from employees
where job_id = (select job_idfrom employeeswhere employee_id = 141
)
and salary > (select salaryfrom employeeswhere employee_id = 143
);

3.返回公司工資最少的員工的last_name,job_id和salary

select last_name,job_id,salary
from employees
where salary = (select min(salary)from employees
);

1.1.1 having后的標(biāo)量子查詢

查詢最低工資大于50號(hào)部門最低工資的部門id和其最低工資

可以拆分去考慮
1.查詢50號(hào)部門最低工資

select min(salary)
from employees
where department_id = 50;

2.查詢每個(gè)部門的最低工資

select department_id,min(salary)
from employees
group by department_id;

3.合并

select department_id,min(salary)
from employees
group by department_id
having min(salary) > (select min(salary)from employeeswhere department_id = 50
);

1.2 where后面的列子查詢

單列多行
IN/NOT IN 任意一個(gè)
ANY/SOME 某一個(gè)
ALL 所有

IN 等于 = ANY

1.返回location_id是1400或1700的部門中的所有員工姓名

select last_name
from employees 
where department_id in (select distinct department_idfrom departmentswhere location_id in (1400,1700)
);

2.返回其它工種中比job_id為’IT_PROG’工種任一工資低的員工的,工號(hào)、姓名、job_id 以及salary

select employee_id,last_name,job_id,salary
from employees
where salary < any (select salaryfrom employeeswhere job_id = 'IT_PROG'
) and job_id <> 'IT_PROG';

1.3 where后面的行子查詢(了解即可)

一行多列或者多行多列

查詢員工編號(hào)最小并且工資最高的員工信息

select *
from employees
where (employee_id,salary) = (select min(employee_id),max(salary)from employees
);

2 from子查詢

查詢每個(gè)部門的平均工資的工資等級(jí)

select avg_dep.department_id,avg_dep.avg,g.grade_level
from job_grades g
inner join (select department_id,avg(salary) as avgfrom employeesgroup by department_id
)as avg_dep
on avg_dep.avg between g.lowest_sal and g.highest_sal;

3 exists子查詢(相關(guān)子查詢)

只關(guān)心有沒有這個(gè)值

查詢有員工的部門名

select department_name
from departments d
where exists(select *from employees ewhere d.department_id = e.department_id
);

4 分頁查詢

limit offset,size
offset 要顯示條目的索引

1.查詢前五條的員工信息

select *
from employees
limit 0,5; #起始索引是0,一共顯示5條

2.查詢第11條~第25條的員工信息

select *
from employees
limit 10,15;

3.有獎(jiǎng)金的員工信息,并且工資較高的前10名顯示出來

select *
from employees
where commission_pct is not null
order by salary desc
limit 10;

5 聯(lián)合查詢

查詢中國(guó)用戶中男性的信息以及外國(guó)用戶中年男性的用戶信息

select * from t_ca where csex='男'
union
select * from t_ua where tGender = 'male';

聯(lián)合查詢的特點(diǎn):
1.要求多條查詢語句的查詢列數(shù)是一致的
2.要求多條查詢語句查詢的每一列的類型和順序最好一致
3.union會(huì)去重
不想去重的話,可以使用union all關(guān)鍵字

6 練習(xí)

1.查詢和zlotkey相同部門的員工姓名和工資

select last_name,salary
from employees
where department_id = (select department_idfrom employeeswhere last_name = 'Zlotkey'
);

2查詢工資比公司平均工資高的員工的員工號(hào),姓名和工資。

select employee_id,last_name,salary
from employees
where salary > (select avg(salary)from employees
);

3查詢各部門中工資比本部門平均工資高的員工的員工號(hào),姓名和工資

select employee_id,last_name,salary
from employees e
inner join (select department_id,avg(salary) as agfrom employeesgroup by department_id
) avg_dep
on avg_dep.department_id = e.department_id
where salary > avg_dep.ag;

4.查詢管理者是king的員工姓名和工資

select last_name,salary
from employees
where manager_id in(select employee_idfrom employeeswhere last_name = 'K_ing'
);

5.查詢工資最高的員工的姓名,要求first_name和iast_name顯示為一列,列名為 姓.名

select concat(first_name,last_name) as '姓.名'
from employees
where salary = (select max(salary)from employees
);
http://www.risenshineclean.com/news/21550.html

相關(guān)文章:

  • 滄浪企業(yè)建設(shè)網(wǎng)站價(jià)格營(yíng)銷軟文范例大全100
  • 建設(shè)銀行網(wǎng)站怎么短信轉(zhuǎn)賬關(guān)鍵詞權(quán)重如何打造
  • 營(yíng)銷型網(wǎng)站建設(shè)極速建站seo推廣軟件排行榜前十名
  • 戶縣規(guī)劃建設(shè)和住房保障局網(wǎng)站沙坪壩區(qū)優(yōu)化關(guān)鍵詞軟件
  • wordpress還是hexo青島seo關(guān)鍵詞優(yōu)化公司
  • 建設(shè)一個(gè)網(wǎng)站app全過程seo權(quán)威入門教程
  • 自己做的網(wǎng)站涉黃網(wǎng)站怎么推廣
  • 成交型網(wǎng)站倡導(dǎo)公司西安百度網(wǎng)站快速排名
  • 成都網(wǎng)站建設(shè)是什么百度店面定位怎么申請(qǐng)
  • 阿里媽媽新建網(wǎng)站怎么做百度客服投訴中心
  • 嘉峪關(guān)市建設(shè)局建管科網(wǎng)站外鏈價(jià)格
  • 查看網(wǎng)站有沒有備案全國(guó)疫情防控最新數(shù)據(jù)
  • 手機(jī)上做整蠱網(wǎng)站全網(wǎng)推廣軟件
  • 農(nóng)產(chǎn)品網(wǎng)站開發(fā) 文獻(xiàn)綜述seo外包公司興田德潤(rùn)官方地址
  • 網(wǎng)站制作技巧百度競(jìng)價(jià)怎么做開戶需要多少錢
  • 找做網(wǎng)站的朋友抖音流量推廣神器軟件
  • 中山商城型網(wǎng)站建設(shè)廣州網(wǎng)站優(yōu)化方式
  • 海報(bào)設(shè)計(jì)分析網(wǎng)站seo的內(nèi)容是什么
  • wordpress c博客seo實(shí)戰(zhàn)密碼第三版pdf下載
  • 有哪些網(wǎng)站做汽車周邊服務(wù)一句簡(jiǎn)短走心文案
  • wordpress可以建官網(wǎng)嘛搜索引擎優(yōu)化排名
  • 新鄉(xiāng)網(wǎng)站建設(shè)百度推廣搜索排名
  • 企業(yè)起名網(wǎng)站怎么做搜索引擎營(yíng)銷的分類
  • 河北網(wǎng)站建設(shè)品牌大全網(wǎng)站seo 工具
  • 阿里云備案?jìng)€(gè)人可以做網(wǎng)站嗎怎么建立一個(gè)網(wǎng)站
  • 網(wǎng)站模板織夢(mèng)免費(fèi)西安百度推廣優(yōu)化公司
  • 公司網(wǎng)站建設(shè)需求書網(wǎng)站設(shè)計(jì)公司哪家專業(yè)
  • 網(wǎng)站欄目劃分怎么做制作網(wǎng)頁的流程
  • 用php和mysql做網(wǎng)站網(wǎng)絡(luò)推廣常見的方法
  • 做網(wǎng)站的技術(shù)支持網(wǎng)絡(luò)營(yíng)銷招聘崗位有哪些