Skip to content

Instantly share code, notes, and snippets.

Last active August 22, 2016 21:43
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bmcbride/149c05758fcca2a43fa0ade639ba6faa to your computer and use it in GitHub Desktop.
Get a direct link to the thumbnail of the first image in a photo field with Fulcrum data shares. Useful for pulling an image into a CartoDB image header info window.
SELECT *, CASE WHEN photos != '' THEN left(photos_url, position('/view' in photos_url)) || split_part(photos, ',', 1) || '/thumbnail.jpg' ELSE photos END AS thumbnail FROM my_fulcrum_table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment