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

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -