Created
October 17, 2014 17:00
-
-
Save bkmorse/8b16bf0c32f20c177ae0 to your computer and use it in GitHub Desktop.
sql for retrieving instagram and twitter entries with url to post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select id, created_at, social_username, source, | |
case source | |
when 'TWITTER' then concat('http://twitter.com/statuses/', social_message_id) | |
when 'INSTAGRAM' then (select instagrams.i_link from instagrams where instagrams.i_id = sweepstakes_entries.social_message_id) | |
end as url | |
from sweepstakes_entries; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment