-

Sql code posted
created at 31 Aug 17:24

Edit | Back
1
(SELECT DISTINCT posts.id, posts.updated_at AS updated_at, posts.created_at AS created_at FROM "posts" INNER JOIN "share_visibilities" ON "share_visibilities"."shareable_id" = "posts"."id" AND "share_visibilities"."shareable_type" = 'Post' INNER JOIN "contacts" ON "contacts"."id" = "share_visibilities"."contact_id" INNER JOIN "aspect_memberships" ON "aspect_memberships"."contact_id" = "contacts"."id" WHERE "posts"."pending" = 'f' AND "share_visibilities"."hidden" = 'f' AND "contacts"."user_id" = 22 AND "contacts"."receiving" = 't' AND "posts"."type" IN ('StatusMessage', 'Reshare') AND "aspect_memberships"."aspect_id" IN (35) AND ("posts"."created_at" < '2013-09-10 15:53:57.000000')  ORDER BY posts.created_at DESC LIMIT 15) UNION ALL (SELECT DISTINCT posts.id, posts.updated_at AS updated_at, posts.created_at AS created_at FROM "posts" INNER JOIN "aspect_visibilities" ON "aspect_visibilities"."shareable_id" = "posts"."id" AND "aspect_visibilities"."shareable_type" = 'Post' WHERE "posts"."author_id" = $1 AND "posts"."pending" = 'f' AND "posts"."type" IN ('StatusMessage', 'Reshare') AND "aspect_visibilities"."aspect_id" IN (35) AND ("posts"."created_at" < '2013-09-10 15:53:57.000000')  ORDER BY posts.created_at DESC LIMIT 15) ORDER BY created_at DESC LIMIT 15
1.25 KB in 4 ms with coderay