顾美玲勾引管家|日韩黄色成人|国产精品theporn动漫|欧美日日日|国产精品探花在线

專業只做數據庫實訓和認證的品牌機構

微信公眾號新浪微博
免費咨詢電話:400-0909-964
當前位置: 網站首頁 > MySQL培訓 > MySQL課程 > MySQL培訓教程:MySQL數據庫表的查詢

MySQL培訓教程:MySQL數據庫表的查詢

文章來源: 更新時間:2016/7/12 11:21:58

在線老師點擊咨詢:

最新學訊:近期OCP認證正在報名中,因考試人員較多請盡快報名獲取最近考試時間,報名費用請聯系在線老師,甲骨文官方認證,報名從速!

我要咨詢

mysql數據庫表的查詢,參考表:student,包括id,name,sex,birth,department,address等幾個字段,存在著一些數據,對這些數據進行相關的查詢

多字段查詢

mysql> select id,name,birth from student;

所有字段查詢

mysql> select * from student;

where指定查詢

mysql> select * from student where id=901;

mysql> select * from student where id>=904;

mysql> select name from student where department='計算機系';

in指定集合查詢

mysql> select * from student where birth in(1988,1990);

mysql> select * from student where id in(903,906);

not in非范圍查詢

mysql> select * from student where birth not in(1990,1998);

between and指定范圍查詢

mysql> select * from student where birth between 1986 and 1988;

not between and不在指定范圍的查詢

mysql> select * from student where id not between 904 and 906;

like字符串匹配查詢

mysql> select * from student where name like '_三';

mysql> select * from student where name like '張三';

mysql> select * from student where name like '張%';

not like不匹配查詢

mysql> select * from student where name not like '張%';

null查詢

mysql> select * from student where address is null;

and多條件查詢

mysql> select * from student where name like '張%' and birth>1985;

mysql> select * from student where name like '張%' and birth>1985 and id like '%3';

or多條件查詢

mysql> select * from student where id=905 or birth=1988;

mysql> select * from student where id=905 or birth=1988 or sex='女';

distinct查詢結果不重復

mysql> select distinct sex from student;

mysql> select distinct department from student;

order by查詢結果排序

mysql> select * from student order by birth;

mysql> select * from student order by birth asc;

mysql> select * from student order by birth desc;

group by分組查詢

mysql> select sex,group_concat(name) from student group by sex;

mysql> select sex,count(name) from student group by sex;

正則表達式查詢

mysql> select * from student where birth regexp '1988|1990';

limit限制查詢結果數量

mysql> select * from student limit 2;

mysql> select * from student limit 1,3;

本文地址:http://www.mudan321.com/mysql/kecheng/12454333902.html 轉載請注明!


PostgreSQL入門到精通 100+ 個學習資料

Oracle培訓機構

金牌講師<>

冉乃綱-老師CUUG金牌講師
冉老師 CUUG金牌講師 Oracle及RedHat高級講師、Unix/Linux 資深專家...[詳細了解老師]

免費咨詢上課流程 客服在線中

陳衛星-老師CUUG金牌講師
陳老師 CUUG金牌講師 精通Oracle管理、備份恢復、性能優化 11年Ora...[詳細了解老師]

免費咨詢上課流程 客服在線中

選學校如何選擇適合自己的學校

CUUG -CHINA UNIX USER GROUP,是國際UNIX組織UNIFORUM的中國代表,是國內悠久的專業UNIX培訓機構,被譽為中國UNIX 的搖籃。多年來,以提高教學質量為本,強調素質教育,積極引進、消化國外的新技術,有效的結合中國....[詳情]

一站式服務(從入學到就業一幫到底)

入學

學習

就業

實操

食宿
地址:北京市海淀區田村山南路35號院17號樓
課程咨詢: 400-0909-964
企業服務:137 1818 8639(陳經理)
部分信息來源于網絡,如有錯誤請聯系指正!
版權所有@北京神腦資訊技術有限公司 (CUUG,中國UNIX用戶協會) Copyright 2016 ALL Rights Reserved 京ICP備11008061號-1