干凈卸載mysql:https://blog.csdn.net/cxy_summer/article/details/70142322
mysql 解壓縮版安裝說明:https://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html
1.mssql中的 FOR XML PATH('') 對比 MySql中的 GROUP_CONCAT(field)
FOR XML PATH的用法:http://www.rzrgm.cn/doubleliang/archive/2011/07/06/2098775.html
GROUP_CONCAT的用法:http://www.rzrgm.cn/appleat/archive/2012/09/03/2669033.html
2.mysql存儲過程(procedure)和函數(shù)(function)的區(qū)別和使用:http://blog.csdn.net/xlxxcc/article/details/52485322
3.mysql自帶各種函數(shù):http://www.rzrgm.cn/kissdodog/p/4168721.html
4.插入數(shù)據(jù)后,返回該條數(shù)據(jù)對應的自增列編號:http://www.rzrgm.cn/moxiaopeng/p/4788722.html
5.limit 用法:select * from tab1 order by id desc limit 0,10 下標從 0 開始。
6.調(diào)用存儲過程,輸入輸出變量,輸出變量無需聲明,參數(shù)不能以@開頭,跟mssql不一樣。
例如:call proc_add_user('jay',@uid);select @uid;
7.每條sql語句結束后都要加上分號,表示真的結束了,換行是沒用的,跟mssql不同。
8.mysql中無法用拼接like,
例如:select * from tab1 where name like '%'+123+'%',需要用 like concat('%',123,'%')來拼接。數(shù)字會自動轉存字符串拼接起來。
9.mysql中 IFNULL、ISNULL、NULLIF的使用:
IFNULL(exp1,exp2):當exp1是null時,返回exp2,否則返回exp1;
ISNULL(exp):當exp是null的時候,返回1,否則返回0;
NULLIF(exp1,exp2):如果exp1=exp2,那么返回值為NULL,否則返回值為exp1。
http://www.rzrgm.cn/JuneZhang/archive/2010/08/26/1809306.html
10.取得前一次MySQL操作所影響的記錄行數(shù),
若上一步操作是select語句,則使用 FOUND_ROWS() ;
若上一步操作是update/modify/delete語句,ROW_COUNT()。
11.Mysql 表連接update/select: http://www.rzrgm.cn/bourneli/archive/2013/01/28/2879519.html
12.mysql 字符串數(shù)字轉換
方法一:SELECT CAST('123' AS SIGNED);
方法二:SELECT CONVERT('123',SIGNED);
方法三:SELECT '123'+0;
//數(shù)字轉字符串 CONCAT()
13.Mysql創(chuàng)建表,建立主鍵、索引、組合主鍵;設置自增,非空,默認值
http://www.rzrgm.cn/ggjucheng/archive/2012/11/03/2752082.html
14.INSERT INTO 和 REPLACE INTO 的區(qū)別
http://www.jb51.net/article/27558.htm
15.truncate table 你的表名 //這樣不但將數(shù)據(jù)全部刪除,而且重新定位自增的字段,truncate命令是會把自增的字段還原為從1開始的,或者你試試把table_a清空,然后取消自增,保存,再加回自增,這也是自增段還原為1 的方法。
方法二:deletefrom 你的表名,dbcc checkident(你的表名,reseed,0) //重新定位自增的字段,讓它從1開始。
16.把MSSQL中的數(shù)據(jù)導入到MySql中
http://www.jb51.net/softjc/158485.html
導入日志:C:\Users\tcdcr\AppData\Roaming\SQLyog\sja.log
18.根據(jù)查詢條件的順序排序
mssql中:order by charindex
mysql中:
select * from a order by substring_index('3,1,2',id,1);
select * from a order by find_in_set(id,'3,1,5')
經(jīng)測試order by substring_index和order by find_in_set都可以。
19.mysql中 INSTR(str,substr) 對應 mssql中CHARINDEX(substr,str) 下標都是從1開始;
20.mysql 隨機函數(shù) ROUND(RAND() * 10000);隨機排序:update tab1 set sortNo=ROUND(RAND() * 10000);
阿里云mysql文檔:https://www.aliyun.com/product/rds/mysql?spm=5176.8006303.267657.13.vfwrBy
http://zhengdl126.iteye.com/category/69054?page=3
21.mysql表分區(qū)
http://www.2cto.com/database/201503/380348.html
http://www.jb51.net/article/42544.htm
22.mysql 索引
http://www.rzrgm.cn/cy163/archive/2008/10/27/1320798.html
http://www.rzrgm.cn/bypp/p/7755307.html
23.mysql事務
http://www.rzrgm.cn/ymy124/p/3718439.html
http://www.runoob.com/mysql/mysql-transaction.html
http://www.rzrgm.cn/in-loading/archive/2012/02/21/2361702.html
http://www.rzrgm.cn/suizhikuo/p/4963560.html
24.mysql退出執(zhí)行存儲過程leave loop
25.mysql查詢:http://www.rzrgm.cn/zhi-ma/p/9345960.html
26.mysql優(yōu)化:http://www.rzrgm.cn/lideqiang0909/p/11162665.html
27.mysql索引優(yōu)化:https://blog.csdn.net/wang5701071/article/details/108797859
浙公網(wǎng)安備 33010602011771號