postgresql - Using regex in WHERE in Postgres -
i have the following query:
select regexp_matches(name, 'foo') table;
how can rewrite regex in following (not working):
select * table regexp_matches(name, 'foo');
current error message is: error: argument of must type boolean, not type text[] sql state: 42804 character: 29
write instead:
select * table name ~ 'foo'
the '~' operator produces boolean result whether regex matches or not rather extracting matching subgroups.
Comments
Post a Comment