Những cách chuyển đổi ngày tháng của một field có kiểu dữ liệu DateTime sang varchar rất hay dùng. Đây là kỹ thuật trong SQL Server --Ki...
Blog đang chỉnh sửa
Những cách chuyển đổi ngày tháng của một field có kiểu dữ liệu DateTime sang varchar rất hay dùng. Đây là kỹ thuật trong SQL Server --Ki...
SET @script :=' foreach($some_id: select column1 from YourTable limit 10) { select $some_id+1, $some_id }'; CALL common_schema.run(@...
foreach(): Invoke a script on each element of given collection. $() is a synonym of this routine. Select multiple columns; execute mu...
Use repeat_exec() to delete huge amount of rows in smaller chunks, with sleeping interval: mysql> call repeat_exec(2, 'DEL...
To use the function, we must install common_schema on MySQL Server. Here is an example: SELECT replace_sections('The quick brown fo...
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; SELECT * FROM YOURTABLE SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE REA...
DELIMITER $$ CREATE FUNCTION CAP_FIRST (input VARCHAR(255)) RETURNS VARCHAR(255) DETERMINISTIC BEGIN DECLARE len INT; DECLAR...
In MySQL, you can use the column alias in the ORDER BY, GROUP BY and HAVING clauses to refer to the column. http://www.mysqltutorial.org/...
This is an useful tip when working with MySQL, I think we can also apply this to SQL Server. SELECT id,title FROM ( SELECT id, title FROM ...
Concatenate string on MySQL CONCAT(column1,' ',column2) http://www.ntu.edu.sg/home/ehchua/programming/sql/MySQL_Beginner.html ...