【发布时间】:2019-07-03 06:47:08
【问题描述】:
我有两个用于广告素材及其缩略图的表格。我想以一种后备方式查询,例如:
Initially, the thumbnail will be displayed for 300x250
IF not available then 336x280,
IF not available then 300x600,
IF not available then 728x90,
IF not available then 160x600,
IF not available then 320x50,
IF not available then 300x50,
IF not available then 468x60
表结构是这样的
creatives:
id INT
name VARCHAR
desc TEXT
creative_thumbs:
id
creative_id INT
dimension VARCHAR
img_url VARCHAR
我已经使用多个连接(每个维度一个,但有点慢)
【问题讨论】:
-
请使用minimal reproducible example的指导添加示例数据。
-
请添加您尝试过的内容,这样我们就不会浪费时间提出您已经尝试过的内容。
标签: mysql join background-image fallback multiple-join-rows