mysql 递归更新
我有两个 mysql 表,一个包含汽车的详细信息,另一个包含汽车的所有可能型号,如下所示:
cars: car_id model [more details] models: model_id model_name
现在,我的问题是存储在“cars”表中的模型详细信息是 model_name,而不是 model_id就是我想要的,
我猜我需要某种递归更新表才能更新 cars.model,但我的大脑停止了工作,不知道该怎么做。 有人对如何做到这一点有任何提示吗?
感谢任何能提供帮助的人!
I have two mysql tables, one containing details on cars and one containing all the possible models of the cars, as such:
cars: car_id model [more details] models: model_id model_name
Now, my problem is that the model details stored in the 'cars' table is the model_name, rather than the model_id which is what I want
I'm guessing I need some kind of recursive UPDATE table to be able to update cars.model, but my brain's stopped working and can't figure out how to do it. Does anyone have any hints on how this would be done?
Thanks to anyone who can help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)