MySQL註釋(轉)
阿新 • • 發佈:2017-10-30
至少 con clas 讀寫分離 指定 例子 讀寫 一個空格 span
MySQL支持3種註釋風格:
1、從‘#’字符從行尾。
2、從‘-- ’序列到行尾。請註意‘-- ’(雙破折號)註釋風格要求第2個破折號後面至少跟一個空格符(例如空格、tab、換行符等等)。
3、從/*序列到後面的*/序列。結束序列不一定在同一行中,因此該語法允許註釋跨越多行。
下面的例子顯示了3種風格的註釋:
SELECT 1+1; # This comment continues to the end of line SELECT 1+1; -- This comment continues to the end of lineSELECT 1 /* this is an in-line comment */ + 1; SELECT 1+ /* this is a multiple-line comment */
4、題外話:
如果使用了Mycat的讀寫分離組件,那麽註釋也能起到一定作用,比如要連接主庫時,Mycat的做法就是從註釋入手,指定主庫。
參考:
http://www.cnblogs.com/end/archive/2011/03/31/2001109.html
MySQL註釋(轉)