两个问题,我想搞一个充值消费模块,可是现在充值的地方,数据库对所有用户都更改金额,我只想对当前登录的用户操作,所以这个sql语录应该怎么写啊。
还有就是消费模块,需要用两个表的数据进行相减(jine-price),保存到jine,这个sql语句又要怎么写啊

















去掉分号

更新的update from就行了
update [user] set [user].jine=[user].jine-car_information.price
from [user]
inner join car_information on [user].username=car_information.username
where [user].username=car_information.username and car_information.username='张三'