bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

使用SQL聚合函數與排序的注意事項有哪些

這篇文章主要介紹了使用SQL聚合函數與排序的注意事項有哪些,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

10年積累的成都做網站、網站設計經驗,可以快速應對客戶對網站的新想法和需求。提供各種問題對應的解決方案。讓選擇我們的客戶得到更好、更有力的網絡服務。我雖然不認識你,你也不認識我。但先做網站設計后付款的網站建設流程,更有定海免費網站建設讓你可以放心的選擇與我們合作。

使用SQL聚合函數與排序的注意事項有哪些

count 函數

語法:

Select count(*)|count(列名) from table_name [where where_defination];Select count(id) from stu;Select count(name) from stu where math > 90;select count (name) from stu where chines+math+English> 250;

sum函數

Select sum (列名) from stu [where where_defination];
Select sum (列名),sum(列名), sum(列名) from stu [where where_definition];
Select sum (列名)+sum(列名)+ sum(列名) from stu [where where_definition];
Select sum (列名)+sum(列名)+sum(列名) as 總分 from stu [where where_definition];
Select sum (列名)/count(name) from stu [where where_defination];
Select avg(math) from stu;
Select avg(math + chines + english) from stu;
Select max|min(列名) from stu;
Select max(math + chines + english) from stu;
Select min(math + chines + english) from stu;

對查詢結果排序

使用order by 子句排序查詢結果

Select column1, column2, column3 from table order by column asc|desc

order by指排序的列,也可以是select后面指定的列名

order by 子句應位于select 語句的結尾

Select name, math from stu order by math;
select name, math+english+chines from stu order by math+english+chines desc;
select name, math+english+chines from stu where name like 'zhang%' order by math+english+chines desc;

使用SQL聚合函數與排序的注意事項有哪些

使用SQL聚合函數與排序的注意事項有哪些

感謝你能夠認真閱讀完這篇文章,希望小編分享的“使用SQL聚合函數與排序的注意事項有哪些”這篇文章對大家有幫助,同時也希望大家多多支持創新互聯,關注創新互聯行業資訊頻道,更多相關知識等著你來學習!

文章題目:使用SQL聚合函數與排序的注意事項有哪些
分享網址:http://vcdvsql.cn/article4/pepoie.html

成都網站建設公司_創新互聯,為您提供網站建設、網站排名、關鍵詞優化手機網站建設全網營銷推廣、建站公司

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都做網站