I currently have the the following query:
select regexp_matches(name, \'foo\') from table;
How can I rewrite this so that the regex is in t
Just use match operator there:
select * from table where name ~ 'foo';
Write instead:
select * from table where name ~ 'foo'
The '~' operator produces a boolean result for whether the regex matches or not rather than extracting the matching subgroups.