我有三个表:连接记录随机
categories (id)
product_models(id, category_id)
products(id, product_id, category_id)
有每个表(Lorem存有内容)的记录,我想连接的数据。
我已经改变了product_models,执行这个查询:
update product_models
set category_id = (select id from categories order by RAND() limit 1)
如何使用单个查询,将所有的产品映射到产品模型并更新类别?
我明白,并会得到它,在这个应用程序项目可以是孤儿。 – yossi