title: Querying JSON fields in Redshift
body: <p>We plan to start using Redshift soon, and one of our fields (columns) is a a JSON value. It's a flat JSON (i.e. by definition no nested levels) and the reason we must use JSON is that each record has different number of different key-value elements, which may very from 0 to 10 or more (so I can't use a field per pair or such).</p>
  
  <p>For example, such field may be {"key1":"value1", "key2":"value2", ..., "key5":"value5"}</p>
  
  <p>I would like to query and count all records having some specific key, and possibly group them by value. In the example above I would like something like "select count(*) where field has key 'key1' group by its value".</p>
  
  <p>Does Redshift support querying by values within the JSON? How can such be achieved?</p>