案例:A给B转10000块钱
1.准备工作:在数据库先建一张表(t_account):
id name balance
-------------------------
1 A 20000
2 B 0
-------------------------
2.模拟银行转账:
实现的步骤:
(1).查询A的账户余额
SELECT * FROM t_account WHERE name='A' AND balance>=10000
>=10000:执行转账 GOTO(2
案例:A给B转10000块钱
1.准备工作:在数据库先建一张表(t_account):
id name balance
-------------------------
1 A 20000
2 B 0
-------------------------
2.模拟银行转账:
实现的步骤:
(1).查询A的账户余额
SELECT * FROM t_account WHERE name='A' AND balance>=10000
>=10000:执行转账 GOTO(2