1, MySQL in the footsteps of SQL to a semicolon (;) end, this is more rigorous than SQL Server.
2. All keywords must be added ', such as status replaced by ' status ', ' by the key '.
3. The dbo of SQL Server. [,] not supported in MySQL, should be removed.
4, IsNull replace Ifnull.
5, RowNumber does not support, you can use SELECT @rownum: [email protected]+1 as Pagerownum from (SELECT @rownum: =0) r instead.
6. CONCAT () instead of +, the number is added except.
7. Group_concat instead of FOR XML Path (").
The @ @ROWCOUNT in 8.SQL server is replaced with MySQL Row_count ().
9. TOP to change the notation of limit.
10. Declare a variable and assign a value to multiple variables from a query statement by: =, as follows:
/* * Declare variable, accept the number @userName, the initial value is: 0 */ Declare int default 0 ;//The default value is 0, note that no parentheses are on either side of the default value. DECLARE loginname varchar (a);//Set Count_user=0/* * The query is named: Number of users @userName */Select @count_user:=count (1), @loginname: = UserName from login;
11. Time Format: Date_format (now (), '%y%m%d ')--20150124 can refer to http://blog.csdn.net/kangbrother/article/details/7030304 in detail.
12. Type conversion to use cast can refer to http://www.nowamagic.net/librarys/veda/detail/2044.
13. Conditional judgment, if then ... end if; If then.. else.. End If;
Len () in 14.SQLSERVER corresponds to length () in MySQL.
15. Modify the data
1.Update`Order', OrderordertransSET`Order`. Cyclesort=Orderordertrans. RIDwhere`Order'. ' Code '=Orderordertrans. ' Code ';//support for MySQL and SQL Server2.UpdateASetA.defaultcycledelivedate=NULL from [Order]AwhereA.cyclesort>@CurrentCycleSort andA.cycle_group=@cycleGroup //Support for server, MySQL not supported
Summary of methods for SQL Server script to MySQL script