I have wrote query like this to check json column has key
SELECT *
FROM "details"
where ("data"->'country'->'state'->>'city') is not null;
but i need to write query which will select row if "data" contains "city"
json structure of data is not consistent.