select product_id,new_price from Products where (product_id,change_date) in (临时表2) 4、临时表1 left join 临时表3,没有出现在表3中的价格记录会被自动赋予null值,用ifnull赋值10: ifnull(b.new_price,10) 完整代码: select a.product_id,ifnull(b.new_price,10) as price from (select disti...
如下Products 表记录着各商品价格变化的情况。其中 (product_id, change_date) 组合为主键。 (product_id, change_date) is the primary key of this table. Each row of this table indicates that the price of some product was changed to a new price at some date. Products Table Description Table: ...
(id, spu_id, title, attribute_template_id, specifications, price, stock, stock_threshold) values (202112010000001, 2, '2021年新款,小米11 Ultra黑色512G,16G超大内存120Hz高刷67w快充', 1, '{"attributes":[{"id":1,"name":"屏幕尺寸","value":"6.1寸"},{"id":3,"name":"颜色","value":...