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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -