There is a request for one line

select * from ( select case when not exists (select 1 from cast (json_extract_path_text(json_array_elements('[{"id":"10058432","bdate":"04.04.2016"},{"id":"10058433","bdate":"01.01.2015"}]'::json),'bdate') as date) where json_extract_path_text between (SELECT create_date from mc_case WHERE closing_step_id = 1) and (SELECT close_date from mc_case WHERE closing_step_id = 1) ) then TRUE else false END from cast (json_extract_path_text(json_array_elements('[{"id":"10058432","bdate":"04.04.2016"},{"id":"10058433","bdate":"01.01.2015"}]'::json),'bdate') as date) group by 1 ) cases where not FALSE; 

How to add a field to the output, which would, when else false , display an additional field (query - which already works with the id field, where case returned false )

  • Instead of false, output it, i.e. just put it in its place, it will pop out - Mike
  • [42804] ERROR: CASE types character varying and boolean can't be matched Position: 9065 writes Tried already - Mitchell Cameron
  • Well, the number of fields should always be the same, since it does not allow to display different types of data, you need to think about what should be when you do not want to display the value, maybe NULL - Mike

0