I am working with a table in SQL that has a 'url' column and I am trying to write a query that pattern-matches some of this url column. For example, I have this table in my schema named 'pages':
name url
1 timmy www.timmy.com/aboutme/p1
2 fred www.getme.com/product
3 tom www.skyme.com/aboutme/r3
4 joe www.five5.com/aboutme
5 chris www.chris.com/contact
6 rich www.noway.com/contact
And I'd like to query the table by pattern matching .com/aboutme in the url. That is, I'd like to return rows 1,3, and 4 because the substring ".com/aboutme" exists in the strings in the url column for these rows. Is this possible? As a follow up, how could this be done if I'd like to pattern-match multiple patterns "match on .com/aboutme AND .com/contact"
Any help is appreciated, as always!
select *
from pages
where url matches substring...
EDIT: This seems like an obvious question that's been asked before - if so, feel free to point me in the right direction on this.