All pastes #410208 Raw Edit

Mine

public text v1 · immutable
#410208 ·published 2007-03-26 05:54 UTC
rendered paste body
SELECT `i`.`id_tm`, `s`.`id_screenshot`
FROM `tm_index` AS `i` 
LEFT JOIN (
  SELECT `s1`.`id_screenshot` , `s1`.`id_tm`, MAX(`s1`.`height`*`s1`.`width`)  AS `surface` 
  FROM `tm_screenshots` AS `s1` 
  WHERE `s1`.`uri` REGEXP '\.(gif|jpg|jpeg|png)$' 
  AND `s1`.`uri` NOT LIKE '%rs%' 
  GROUP BY `s1`.`id_screenshot`)  AS `s` ON `s`.`id_tm` = `i`.`id_tm` 
LEFT JOIN `tm_styles` AS `st` ON `st`.`id_tm` = `i`.`id_tm` 
LEFT JOIN `tm_categories` AS `cat` ON `cat`.`id_tm` = `i`.`id_tm` 
WHERE  `i`.`state` = 1 
AND ( i.id_tm IN ( 
  SELECT `k`.`id_tm` 
  FROM `tm_keywords` AS `k` 
  LEFT JOIN `tm_keywords_index` AS `ki` ON `k`.`id_keyword` = `ki`.`id_keyword` 
  WHERE MATCH (`ki`.`label_en`) AGAINST ('music photos') > 0 
  ) 
) 
AND (`i`.`id_tm` = '13775' 
  OR `i`.`id_tm` = '10781' 
  OR `i`.`id_tm` = '11568' 
  OR `i`.`id_tm` = '12397') 
AND `i`.`id_type` = 17 
AND `i`.`price` >= 20 
AND `i`.`price` <= 60 
AND `st`.`id_style` = 16 
AND `cat`.`id_category` = 94 
GROUP BY `i`.`id_tm` ORDER BY `i`.`id_tm` DESC