Skip to content

Instantly share code, notes, and snippets.

@ederrafo
Created August 28, 2015 23:12
Show Gist options
  • Save ederrafo/8addbb013e42c019968c to your computer and use it in GitHub Desktop.
Save ederrafo/8addbb013e42c019968c to your computer and use it in GitHub Desktop.
select partneruser::json->>'id', partneruser::json->>'name' from hotels where partneruser::json->>'id' = '8892'
select SUBSTRING(verificationdate::varchar, 1, 10),count(id)
--, verificationdate
FROM hotels where verificationdate is not null
group by 1
order by 1 desc
http://schinckel.net/2014/05/25/querying-json-in-postgres/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment