我们如何编写MySQL存储过程以从表中选择所有数据?
为了证明这一点,我们创建了一个名为“selectdetails()”的过程,该过程将从表“student_detail”中获取所有记录。
mysql> Delimiter // mysql> Create Procedure selectdetails() -> BEGIN -> Select * from student_detail; -> END//
现在,在调用此过程之后,我们将从'student_detail'表中获取所有记录。
mysql> Delimiter ; mysql> CALL selectdetails(); +-----------+-------------+------------+ | Studentid | StudentName | address | +-----------+-------------+------------+ | 100 | Gaurav | Delhi | | 101 | Raman | Shimla | | 103 | Rahul | Jaipur | | 104 | Ram | Chandigarh | | 105 | Mohan | Chandigarh | +-----------+-------------+------------+ 5 rows in set (0.00 sec)
热门推荐
10 祝福语精选简短正能量
11 谢谢同事英文祝福语简短
12 20春节祝福语大全简短
13 夜雨祝福语简短10字
14 文艺乔迁祝福语简短精辟
15 火把节祝福语简短
16 生日高考祝福语妹妹简短
17 冬日问候祝福语大全简短
18 退伍祝福语老师简短