Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How to do pattern matching in postgres regex?

Asked by Ajith Jayaraman Oct 3, 2022 1.2K views 1 answer
Share

About this question

 I had to write a simple query where I go looking for people's name that start with a B or a D :


SELECT s.name 

FROM spelers s 

WHERE s.name LIKE 'B%' OR s.name LIKE 'D%'

ORDER BY 1

I was wondering if there is a way to rewrite this to become more performant. So can I avoid or and / or like?

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.