item_middle_thm_view.sql 523 B

12345678910111213141516171819
  1. create or replace view item_middle_thm_view as
  2. select
  3. dbr_item.*, bd_file_url,
  4. media_id1, media_id2, media_id3, media_id4, media_id5,
  5. pc1, pc2, pc3, pc4, pc5, pc6, pc7, pc8, pc9, pc10,
  6. pd1, pd2, pd3, pd4, pd5, pd6, pd7, pd8, pd9, pd10
  7. from
  8. dbr_item
  9. inner join dbr_igroup on dbr_igroup.id = dbr_igroup.id
  10. inner join dbr_item_thm on dbr_item.id = dbr_item_thm.id
  11. left join
  12. ( select
  13. media_id,
  14. bd_file_url
  15. from
  16. dbr_media_bd
  17. where image_type = 'middle'
  18. ) as com
  19. on com.media_id = dbr_item.media_id