Guest User

Untitled

a guest
Aug 18th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.64 KB | None | 0 0
  1. SELECT
  2.         SQL_CALC_FOUND_ROWS gs.gallery_id,
  3.         gs.thumb_id,
  4.         gi.sponsor_id,
  5.         gi.content_count,
  6.         gi.content_type,
  7.         gs.total_shows,
  8.         gs.total_clicks,
  9.         gs.total_ctr,
  10.         gt.thumb_url,
  11.         gd.*,
  12.         gi.content_count,
  13.         gi.crop_profile_id,
  14.         gs.activation_date,
  15.         gi.added_date,
  16.         gi.duration,
  17.         gi.url,
  18.         gi.gallery_total_shows,
  19.         gi.sponsor_id,
  20.         gi.source_url,
  21.         gi.custom_gallery
  22.     FROM
  23.         rot_gallery_stats1 AS gs
  24.     JOIN
  25.         rot_gallery_info AS gi
  26.             ON gi.gallery_id = gs.gallery_id
  27.     JOIN
  28.         rot_gallery_data15 AS gd
  29.             ON gd.gallery_id = gs.gallery_id
  30.     JOIN
  31.         rot_gal2tag
  32.             ON rot_gal2tag.gallery_id = gs.gallery_id
  33.     JOIN
  34.         rot_thumbs AS gt
  35.             ON gt.thumb_id = gs.thumb_id
  36.     WHERE
  37.         1 = 1
  38.         AND gi.gallery_status = 'active'
  39.         AND gi.gallery_type = 0
  40.         AND gs.best_thumb = 'yes'
  41.         AND gi.sponsor_id NOT IN (
  42.             3
  43.         )
  44.         AND gs.group_id = 0
  45.         AND EXISTS (
  46.             SELECT
  47.                 1
  48.             FROM
  49.                 rot_gal2tag
  50.             WHERE
  51.                 (
  52.                     rot_gal2tag.tag_id IN (
  53.                         4755
  54.                     )
  55.                 )
  56.                 AND (
  57.                     gs.gallery_id = rot_gal2tag.gallery_id
  58.                 )
  59.         )
  60.     GROUP BY
  61.         gs.gallery_id,
  62.         gs.thumb_id
  63.     ORDER BY
  64.         gs.tested_thumb DESC,
  65.         gs.total_ctr DESC LIMIT 60,
  66.         60
Advertisement
Add Comment
Please, Sign In to add comment