JSON ARRAY CONTAINS code example

Example: postgresql json array contains

CREATE TABLE public.json_table (myjson json);
INSERT INTO public.json_table VALUES('{"coord":{"lon":-0.13,"lat":51.51},"sys": {"type":3,"id":98614,"message":0.0218,"country":"GB","sunrise":1427693969,"sunset":1427740219},"weather": [{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"main": {"temp":6.99,"humidity":57,"pressure":1014.9,"temp_min":5.56,"temp_max":10.3},"wind": {"speed":0.7,"gust":1.7,"deg":315},"rain":{"3h":0},"clouds": {"all":64},"dt":1427699997,"id":2643743,"name":"London"}');
INSERT INTO public.json_table VALUES('{"coord":{"lon":-1.47,"lat":53.38},"sys":{"type":3,"id":38764,"message":0.0121,"country":"GB","sunrise":1427694192,"sunset":1427740640},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"main":{"temp":4.64,"humidity":75,"pressure":988,"temp_min":4.44,"temp_max":5},"wind":{"speed":3.08,"gust":7.71,"deg":226},"rain":{"3h":0.03},"clouds":{"all":36},"dt":1427699954,"id":2638077,"name":"Sheffield"}');
INSERT INTO public.json_table VALUES('{"coord":{"lon":-2.98,"lat":53.41},"sys":{"type":3,"id":10567,"message":0.0519,"country":"GB","sunrise":1427694552,"sunset":1427741005},"weather":[{"id":800,"main":"Clear","description":"Sky is Clear","icon":"01d"}],"main":{"temp":8,"humidity":67,"pressure":1000,"temp_min":3.33,"temp_max":17.78},"wind":{"speed":4.63,"gust":7.2,"deg":282},"rain":{"3h":0},"clouds":{"all":0},"dt":1427700074,"id":2644210,"name":"Liverpool"}');
INSERT INTO public.json_table VALUES('{"coord":{"lon":-2.24,"lat":53.48},"sys":{"type":3,"id":28022,"message":0.0377,"country":"GB","sunrise":1427694371,"sunset":1427740831},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"main":{"temp":4.66,"pressure":1004,"temp_min":3.33,"temp_max":6.11,"humidity":89},"wind":{"speed":3.6,"gust":5.65,"deg":268},"rain":{"3h":0.0099999999999998},"clouds":{"all":24},"dt":1427700074,"id":2643123,"name":"Manchester"}');
INSERT INTO public.json_table VALUES('{"coord":{"lon":-1.13,"lat":52.64},"sys":{"type":3,"id":184635,"message":0.9267,"country":"GB","sunrise":1427694152,"sunset":1427740519},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"main":{"temp":4.92,"humidity":75,"pressure":1013,"temp_min":4.4,"temp_max":5.4},"wind":{"speed":2.9,"gust":7.5,"deg":337},"rain":{"3h":0.024999999999999},"clouds":{"all":36},"dt":1427700055,"id":2644668,"name":"Leicester"}');