DELIMITER $$ and DELIMITER;
DROP PROCEDURE IF EXISTS ' pro_follow_getbookbeforeexpired ' $$
DECLARE P_servicecode VARCHAR (50);
SET p_servicecode = ' Yygh ';
IF P_expiredminute = 0
Then
...;
ELSE IF p_expiredminute > 0
Then
...;
ELSE
Then
...;
END IF
;
The Where EXISTS across tables can be replaced with a LEFT join
Date_add (PD. ' CreationDate ', INTERVAL (p_expiredminute-p_alertminute) MINUTE) <= now ()--10 minutes in advance
Line number
SELECT (@rowNO: = @rowNo + 1) as ' line number ', t.*
From ' Tb_cc_task ' as T
, (SELECT @rowNO: = 0) as B
SELECT (case if t.a = 2 Then ' 1 ' ELSE ' 2 ' END) as Payment type
CONCAT (' str1 ', ' str2 ', ' STR3 ')
Function to return a scalar
Global TEMP variable
SET @a = 1;
SELECT @a;
Modify the table itself
UPDATE ' xxx '
SET ' memberpassword ' = ' 670b14728ad9902aecba32e22fa4f6bd '
WHERE ' ID ' in
(
SELECT C. ' ID '
From (
SELECT b.*
From ' Tb_mb_hosptalmember ' A
JOIN ' Tb_mb_memberinfo ' B on A. ' MemberID ' = B. ' ID '
) C
)
Trigger:
DELIMITER $$
Use ' Boshcc_dev ' $$
DROP TRIGGER/*!50032 IF EXISTS */' trigger_tb_hs_healthmanage_isuploaded ' $$
CREATE
/*!50017 definer = ' root ' @ '% ' */
TRIGGER ' trigger_tb_hs_healthmanage_isuploaded ' before UPDATE on ' Tb_hs_healthmanage '
For each ROW BEGIN
IF New. ' isuploaded ' = old. ' Isuploaded '
Then
SET New. ' isuploaded ' = FALSE;
END IF;
END;
$$
DELIMITER;
Mysql Detail Memory