Advertisement
kromm77

Postgresl json object

Jan 13th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.37 KB | None | 0 0
  1. SELECT json_data->>'linename' l ,k ,json_data->>k v
  2.  FROM copperline, lateral json_object_keys( json_data ) k WHERE json_data->>'linename' LIKE '40000100188';
  3.  
  4. SELECT service_name,service_type,crm_customer_id,   crm_contract_id ,  STATUS,k->'key' k,k->'value' v
  5.  FROM service , lateral json_array_elements( json_data->'attributes' ) k  
  6. WHERE service_type LIKE 'ACCESS%'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement