sql - Select empty column if regexp_match fails -
i'm trying select entities, if they're not match expression, 1 returns 'true' values.
select entity_id, regexp_matches(error_params, '"select_flight"') not null mytable group 1
is there way solve such issue inside select
statement or in case should use left join
table regexp_matches
result?
if i'm understanding question correctly, can use count
case
:
select entity_id, count(case when error_params '%select flight%' 1 end) cnt mytable group 1
Comments
Post a Comment