MySQL CREATE view, build stored procedure

Source: Internet
Author: User
Tags mysql create
--Select * FROM (select Nid from Part where nid > 2) as A--Create view V1 as – Create View V1 as #创建视图--Select Man _to_woman.nid,man.name as mname,woman.name as Wname from man_to_woman--left JOIN man on man_to_woman.man_id = man.nid--L EFT JOIN woman on man_to_woman.woman_id = woman.nid--where man.name = ' duyanqi ' delimiter \ \  #声明以 \ \ For statement terminator (default; semicolon end) Dro P PROCEDURE if EXISTS proc_p1 \create PROCEDURE proc_p1 (in I1 int) #生成存储过程, gets a variable i1begin--SELECT * from Man;declare D1 INT ; #声明变量DECLARE D2 int DEFAULT 3;set D1 = i1 + d2; SELECT * from Man_to_woman WHERE nid > D1; END \delimiter; #将默认的; change back call PROC_P1 (1); #调用存储过程 #drop procedure proc_p1; #删除存储过程

  

MySQL CREATE view, build stored procedure

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.