如何在mysql中创建程序来选择记录?

时间:2011-02-18 14:14:06

标签: mysql stored-procedures

如何在mysql中编写程序,用IN和OUT参数从特定表中选择记录?

1 个答案:

答案 0 :(得分:3)

delimiter //

create procedure sample (in id int, out MyCount int)
begin
    select count(*) into MyCount 
        from YourTable 
        where YourKey = id;
end//