Skip to content

Instantly share code, notes, and snippets.

@americos
Created July 24, 2013 19:48
Show Gist options
  • Save americos/6073893 to your computer and use it in GitHub Desktop.
Save americos/6073893 to your computer and use it in GitHub Desktop.
video_clip.paginate_newest_by_category MS Query for Home and Garden
SELECT distinct(video_clips.id), video_clips.filename, video_clips.title,
video_clips.video_id, video_clips.thumb_file_name, video_clips.stands_alone,
video_clips.is_thumbset_hosted, video_clips.headline, categories_videos.video_id,
categories_videos.category_id, videos.is_live, videos.is_ugc, videos.is_private,
videos.live_date FROM `video_clips` INNER JOIN `videos` ON `videos`.`id` = `video_clips`.`video_id` INNER JOIN `categories_videos` ON `categories_videos`.`video_id` = `videos`.`id` INNER JOIN `categories` ON `categories`.`id` = `categories_videos`.`category_id` WHERE (videos.is_live = 1 AND
videos.is_ugc = 0 AND
videos.is_private = 0 AND
(videos.is_deleted IS NULL OR videos.is_deleted = 0) AND
categories_videos.category_id IN (111,112,113,114,115,116,117,118,119,120,121,122,123,124,125)) ORDER BY video_clips.stands_alone DESC, videos.live_date DESC LIMIT 15 OFFSET 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment