Match a string in a postgresql WHERE clause with LIKE

You can use LIKE in a sql where clause.

LIKE takes a string that can contain a % which means zero or more characters of anything. Or a _ which means one character of anything.

select name from people where name like '_a%';

That will match any name has has an a for a second character and then zero or more characters of anything else.

sql postgresql

Edit on github
comments powered by Disqus
Click me