jeudi 30 août 2018

DB2 LIKE matching Pattern

My question is simple.

In a DB2 Database, I have my table

Table (Id integer, name varchar)

I want to select entries which names like 'ac1%' or 'ac2%' or 'ac3%', so which names match regex

'^ac[123]*' 

Is there any method to have this select query without write :

WHERE name LIKE 'ac1%' OR name LIKE 'ac2%' OR name LIKE 'ac2%'

Aucun commentaire:

Enregistrer un commentaire