我们如何编写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 50多岁生日简短祝福语
13 安徽疫情祝福语简短英语
14 农民朋友发财祝福语简短
15 对生活祝福语简短精辟
16 搬家词简短祝福语朋友
17 女神结婚快乐祝福语简短
18 文学短句祝福语大全简短