您好,登錄后才能下訂單哦!
這篇文章主要講解了“shark怎么使用”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“shark怎么使用”吧!
//查詢有多少行數(shù)據(jù)
Select count(*) from SOGOUQ1;
//顯示前10行數(shù)據(jù)
select * from SOGOUQ1 limit 10;
//session查詢次數(shù)排行榜
select WEBSESSION,count(WEBSESSION) as cw from sogouQ1 group by WEBSESSION order by cw desc limit 10;
//建立cache表
create table sogouQ1_cached as select * from sogouq1;
//搜索結(jié)果排名第1,但是點(diǎn)擊次序排在第2的數(shù)據(jù)有多少?
select count(*) from sogouQ1_cached where S_SEQ=1 and C_SEQ=2;
//搜索用戶點(diǎn)擊的URL含baidu的數(shù)據(jù)有多少?
select count(*) from sogouQ1_cached where WEBSITE like '%baidu%';
//搜索結(jié)果排名第1,但是點(diǎn)擊次序排在第2,URL含baidu的數(shù)據(jù)有多少?
select count(*) from sogouQ1_cached where S_SEQ=1 and C_SEQ=2 and WEBSITE like '%baidu%';
//session查詢次數(shù)排行榜
select WEBSESSION,count(WEBSESSION) as cw from sogouQ1_cached group by WEBSESSION order by cw desc limit 10;
***************************************************************
***************************************************************
***************************************************************
//切換數(shù)據(jù)庫
use saledata;
//所有訂單中總銷售額
//select sum(b.amount) from tblStock a,tblStockDetail b where a.ordernumber=b.ordernumber
select sum(tblStockDetail.amount) from tblStock join tblStockDetail on tblStock.ordernumber=tblStockDetail.ordernumber;
43129783
68100782
//select sum(b.amount) from tblStock a,tblStockDetail b,tbldate c where a.ordernumber=b.ordernumber and a.dateid=c.dateid;
select sum(tblStockDetail.amount) from tblStock join tblStockDetail on tblStock.ordernumber=tblStockDetail.ordernumber join tbldate on tblstock.dateid=tbldate.dateid;
43128080 shark
68099079 hive
感謝各位的閱讀,以上就是“shark怎么使用”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對shark怎么使用這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是億速云,小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。