mysql英文參考手冊some keys

MySQL參考手冊版本:refman-5.6-en.a4.pdf
下載地址:http://dev.mysql.com/doc/index-archive.html

  • Options on the command line take precedence over values specified in option files and environmentvariables, and values in option files take precedence over values in environment variables. [2.12]
  • On character type columns, sorting—like all other comparison operations—is normally performed in a case-insensitive fashion.This means that the order is undefined for columns that are identical except for their case. You can force a case-sensitive sort for a column by using BINARY like so: ORDER BY BINARY col_name. [3.3.4.4]
    簡譯:對于字符型列來說摘投,排序是不區(qū)分大小寫的。如果想讓字符型列排序區(qū)分大小寫可以使用BINARY,如:ORDER BY BINARY col_name
  • TIMESTAMPDIFF(YEAR,birth,CURDATE()) as age =》計算年齡
  • MONTH(birth) = MOD(MONTH(CURDATE()), 12) + 1;=》選擇得到生日在下個月窒篱。MOD()進行取模運算[3.3.4.6]
  • You cannot use arithmetic comparison operators such as =, <, or <> to test for NULL. [3.3.4.6] =>計算符號對NULL是沒有任何意義的
  • In MySQL, 0 or NULL means false and anything else means true. The default truth value from a boolean operation is 1. =》在MySQL中,0或者NULL都是false的意思,其他的則為true阱州。從bool運算中得到true值是用1表示
  • Two NULL values are regarded as equal in a GROUP BY.
  • When doing an ORDER BY, NULL values are presented first if you do ORDER BY ... ASC and last if you do ORDER BY ... DESC.
  • A common error when working with NULL is to assume that it is not possible to insert a zero or an empty string into a column defined as NOT NULL, but this is not the case. =》使用NULL一個常見的錯誤就是以為對聲明為NOT NULL的列不能插入0或者空字符串,其實是可以的法梯。
  • SQL pattern matching enables you to use “_” to match any single character and “%” to match an arbitrary number of characters (including zero characters).=>SQL正則表達式允許使用"_"來匹配任意單個字符,使用“%”來匹配任意個數(shù)字符苔货,包括0個石挂。[3.3.4.7]
  • In MySQL, SQL patterns are caseinsensitive by default.=》MySQL中正則表達式對大小寫并不敏感救军。
  • SELECT * FROM pet WHERE name REGEXP '^b';
  • If you really want to force a REGEXP comparison to be case sensitive, use the BINARY keyword to make one of the strings a binary string.SELECT * FROM pet WHERE name REGEXP BINARY '^b';
  • If you want to get the interactive output format in batch mode, use mysql -t. To echo to the output the statements that are executed, use mysql -v. =》如果想在批處理模式也就是source file這種模式下的輸出和登錄MySQL的輸出一樣是表狀的,那么就是用mysql -t選項啸胧。如果你想同時在輸出時同時打印執(zhí)行的sql铛绰,使用-v選項诈茧。
  • MySQL does not perform any sort of CHECK to make sure that col_name actually exists in tbl_name (or even that tbl_name itself exists).[3.6.6]=>MySQL的references tbl_name(col_name)語法不會做任何col_name是否存在的檢查,即使tal_name是存在的捂掰。這里只是說references這個語法敢会,并不是說創(chuàng)建外鍵時不檢查目標表和目標列的存在.
  • When you insert any other value into an AUTO_INCREMENT column, the column is set to that value and the sequence is reset so that the next automatically generated value follows sequentially from the largest column value.
  • For a multiple-row insert, LAST_INSERT_ID() and mysql_insert_id() actually return the AUTO_INCREMENT key from the first of the inserted rows.
  • --column-names option that determines whether or not to display a row of columnnames at the beginning of query results. [4.2.5 ] =>這樣子來說的話,--column-names這個參數(shù)在用來執(zhí)行select一個表數(shù)據(jù)時還是蠻好用的这嚣。因為默認是會把列名一起導出來的
#enalbled
--disable-column-names
--skip-column-names
--column-names=0 
#disabled
--column-names
--enable-column-names
--column-names=1 
  • A MySQL program started with the --no-defaults option reads no optionfiles other than .mylogin.cnf [4.2.6 ]
  • !include directives in option files to include other option files and !includedir to search specific directories for option files. **Any files to be found and included using the !includedir directive on Unixoperating systems must have file names ending in .cnf. **
!include /home/mydir/myopt.cnf 
!includedir /home/mydir 
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末鸥昏,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子姐帚,更是在濱河造成了極大的恐慌吏垮,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,084評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件罐旗,死亡現(xiàn)場離奇詭異膳汪,居然都是意外死亡,警方通過查閱死者的電腦和手機九秀,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,623評論 3 392
  • 文/潘曉璐 我一進店門遗嗽,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人颤霎,你說我怎么就攤上這事。” “怎么了友酱?”我有些...
    開封第一講書人閱讀 163,450評論 0 353
  • 文/不壞的土叔 我叫張陵晴音,是天一觀的道長。 經常有香客問我缔杉,道長锤躁,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,322評論 1 293
  • 正文 為了忘掉前任或详,我火速辦了婚禮系羞,結果婚禮上,老公的妹妹穿的比我還像新娘霸琴。我一直安慰自己椒振,他們只是感情好,可當我...
    茶點故事閱讀 67,370評論 6 390
  • 文/花漫 我一把揭開白布梧乘。 她就那樣靜靜地躺著澎迎,像睡著了一般。 火紅的嫁衣襯著肌膚如雪选调。 梳的紋絲不亂的頭發(fā)上夹供,一...
    開封第一講書人閱讀 51,274評論 1 300
  • 那天,我揣著相機與錄音仁堪,去河邊找鬼哮洽。 笑死,一個胖子當著我的面吹牛弦聂,可吹牛的內容都是我干的鸟辅。 我是一名探鬼主播,決...
    沈念sama閱讀 40,126評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼横浑,長吁一口氣:“原來是場噩夢啊……” “哼剔桨!你這毒婦竟也來了?” 一聲冷哼從身側響起徙融,我...
    開封第一講書人閱讀 38,980評論 0 275
  • 序言:老撾萬榮一對情侶失蹤洒缀,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后欺冀,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體树绩,經...
    沈念sama閱讀 45,414評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,599評論 3 334
  • 正文 我和宋清朗相戀三年隐轩,在試婚紗的時候發(fā)現(xiàn)自己被綠了饺饭。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,773評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡职车,死狀恐怖瘫俊,靈堂內的尸體忽然破棺而出鹊杖,到底是詐尸還是另有隱情,我是刑警寧澤扛芽,帶...
    沈念sama閱讀 35,470評論 5 344
  • 正文 年R本政府宣布骂蓖,位于F島的核電站,受9級特大地震影響川尖,放射性物質發(fā)生泄漏登下。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,080評論 3 327
  • 文/蒙蒙 一叮喳、第九天 我趴在偏房一處隱蔽的房頂上張望被芳。 院中可真熱鬧,春花似錦馍悟、人聲如沸畔濒。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,713評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽篓冲。三九已至,卻和暖如春宠哄,著一層夾襖步出監(jiān)牢的瞬間壹将,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,852評論 1 269
  • 我被黑心中介騙來泰國打工毛嫉, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留诽俯,地道東北人。 一個月前我還...
    沈念sama閱讀 47,865評論 2 370
  • 正文 我出身青樓承粤,卻偏偏與公主長得像暴区,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子辛臊,可洞房花燭夜當晚...
    茶點故事閱讀 44,689評論 2 354

推薦閱讀更多精彩內容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,324評論 0 10
  • 昆明中如慈善委員會 扶老仙粱、助學、救孤彻舰、濟困 緣起 慈善活動始于1995年伐割,以公司組織的形式,資金來源于公司刃唤、員工隔心、...
    昆明中如慈委會閱讀 706評論 0 0
  • 之前也發(fā)過一篇西洋草藥的采收,發(fā)現(xiàn)和中藥采收的參考因素和原則是差不多相同的尚胞,所以可以結合著看硬霍。
    yarrowwww閱讀 187評論 0 2
  • 全球時刻,全國連鎖笼裳,是線上線下相結合的跨境品牌折扣店唯卖,主要經營的商品有上千種粱玲,包括母嬰用品,化妝品拜轨,生活用...
    6d09a43af1ec閱讀 357評論 0 0
  • 我希望明天是刷個牙密幔,洗個臉,再寫一篇文章撩轰。
    haoqiii閱讀 184評論 1 0