sql - PostgreSQL WHERE IN LIKE query -
i wondering if it's possible query using in clause options inside clauses, example have existing sql returns same results intend seems round way it.
select * pg_stat_activity application_name not '%psql%' , (current_timestamp - state_change) > interval '30 minutes' , state in ( select state pg_stat_activity state '%idle%' or state '%disabled%' )
is there way replace along lines of
select * pg_stat_activity application_name not '%psql%' , (current_timestamp - state_change) > interval '30 minutes' , state in ('%idle%', '%disabled%')
use similar to instead of like
and state similar '%(idle|disabled)%'
https://www.postgresql.org/docs/9.0/static/functions-matching.html
Comments
Post a Comment