學(xué)習(xí)mysql之后的一點(diǎn)總結(jié)(基礎(chǔ))
更新時(shí)間:2012年05月21日 11:27:53 作者:
學(xué)習(xí)mysql之后的一點(diǎn)總結(jié),比較適合新手朋友
1.想要在命令提示符下操作mysql服務(wù)器,添加系統(tǒng)變量。(計(jì)算機(jī)-系統(tǒng)屬性——環(huán)境變量——path)
2.查詢數(shù)據(jù)表中的數(shù)據(jù);
select selection_list select * /columns
from table_list from table1/table2
where primary_constraint
group by grouping_columns
order by sorting_colomns desc降序 select * from table order by id desc;
having second_constraint
limit count select * from table where id limit 1,4;
2 常用的統(tǒng)計(jì)函數(shù):avg(字段),sum(字段),count(字段),min(字段),
select sum(字段2) as 別名 ,字段1 from table group by 字段1;
3 算數(shù)運(yùn)算,字符串,以及邏輯運(yùn)算構(gòu)造表達(dá)式:select * (price*0.8) as '80%' from table;打八折
2.查詢數(shù)據(jù)表中的數(shù)據(jù);
select selection_list select * /columns
from table_list from table1/table2
where primary_constraint
group by grouping_columns
order by sorting_colomns desc降序 select * from table order by id desc;
having second_constraint
limit count select * from table where id limit 1,4;
2 常用的統(tǒng)計(jì)函數(shù):avg(字段),sum(字段),count(字段),min(字段),
select sum(字段2) as 別名 ,字段1 from table group by 字段1;
3 算數(shù)運(yùn)算,字符串,以及邏輯運(yùn)算構(gòu)造表達(dá)式:select * (price*0.8) as '80%' from table;打八折
相關(guān)文章
MySQL提示Truncated incorrect DOUBLE value解決方法
這篇文章給大家介紹了MySQL提示Truncated incorrect DOUBLE value報(bào)錯(cuò)的四種解決方法,并通過代碼給大家介紹的非常詳細(xì),具有一定的參考價(jià)值,需要的朋友可以參考下2024-02-02Mysql8報(bào)錯(cuò)this is incompatible with sql_mo
這篇文章主要介紹了Mysql8報(bào)錯(cuò)this is incompatible with sql_mode=only_full_group_by問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-01-01mysql運(yùn)行net start mysql報(bào)服務(wù)名無效的解決辦法
這篇文章主要為大家詳細(xì)介紹了mysql運(yùn)行net start mysql報(bào)服務(wù)名無效的解決辦法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-01-01淺談MyISAM 和 InnoDB 的區(qū)別與優(yōu)化
InnoDB和MyISAM是在使用MySQL最常用的兩個(gè)表類型,各有優(yōu)缺點(diǎn),視具體應(yīng)用而定。下面我們就來具體探討下吧2015-07-07mysql Access denied for user ‘root’@’localhost’ (using passw
這篇文章主要介紹了mysql Access denied for user ‘root’@’localhost’ (using password: YES)解決方法,本文給出詳細(xì)的解決步驟及操作注釋,需要的朋友可以參考下2015-07-07一個(gè) 20 秒 SQL 慢查詢優(yōu)化處理方案
這篇文章主要分享一個(gè) 20 秒 SQL 慢查詢優(yōu)化的經(jīng)歷與處理方案,頁面無法正確獲取數(shù)據(jù),經(jīng)排查原來是接口調(diào)用超時(shí),而最后發(fā)現(xiàn)是因?yàn)镾QL查詢長(zhǎng)達(dá)到20多秒而導(dǎo)致了問題的發(fā)生,下面來看問題具體介紹吧2022-01-01