我想根据接收到的recordType来执行不同的sql,
看了一下应该时用case when吧,然后捣鼓了一下不行,
请求大神指点一二。
CASE when ats_wallet_record.record_type=1 THEN UPDATE ats_wallet set ats_wallet.balance =ats_wallet.balance+10
when ats_wallet_record.record_type=2 THEN UPDATE ats_wallet set ats_wallet.balance =ats_wallet.balance-10
ELSE end
FROM ats_wallet UNION ats_wallet_record ON ats_wallet.id=ats_wallet_record.wallet_id where ats_wallet.account_id=26421576974992178;
就是当recordType未1则钱包增加,2则减少。
谢谢