hehexu

博客园 首页 新随笔 联系 订阅 管理
mysql> create database db1;
mysql> use db1;    
mysql> create table PLAYERS as select * from TENNIS.PLAYERS;
mysql> create table MATCHES  as select * from TENNIS.MATCHES;

mysql> delimiter $$  #将语句的结束符号从分号;临时改为两个$$(可以是自定义)
mysql> CREATE PROCEDURE delete_matches(IN p_playerno INTEGER)
    -> BEGIN
    ->   DELETE FROM MATCHES
    ->    WHERE playerno = p_playerno;
    -> END$$
Query OK, 0 rows affected (0.01 sec)

mysql> delimiter ;  #将语句的结束符号恢复为分号

mysql> call delete_matches(57);
Query OK, 1 row affected (0.03 sec)

???????????????????????????????????????
posted on 2018-12-02 11:56  hehexu  阅读(200)  评论(0编辑  收藏  举报