Mysql Detail Memory

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.