Re: Selecting all variations of job title in a list
| От | Vincent Veyron |
|---|---|
| Тема | Re: Selecting all variations of job title in a list |
| Дата | |
| Msg-id | 20251126154844.e6e3d5c7f476cc966fc201f4@wanadoo.fr обсуждение исходный текст |
| Ответ на | Selecting all variations of job title in a list (Rich Shepard <rshepard@appl-ecosys.com>) |
| Ответы |
Re: Selecting all variations of job title in a list
|
| Список | pgsql-general |
On Tue, 25 Nov 2025 08:33:07 -0800 (PST) Rich Shepard <rshepard@appl-ecosys.com> wrote: > Companies can have slightly different titles for the same job; for example > (using abbreviations). 'Asst Gen Mgr.', 'Env Mgr,', 'Gen Mgr,'. 'Mgr,', > 'Plant Mgr.' > > I want to select all people table rows that contain these varieties. I know > the 'like' operator uses '%' as a wildcard, but is not accepted in an 'in' > list. > > Is there a way to use a multicharacter wildcard in an 'in' list? > Hi Rich, As Ron wrote, a regexp would do it, I guess? SELECT * FROM people WHERE title ~ 'Asst Gen Mgr|Env Mgr|Gen Mgr|Mgr|Plant Mgr'; Although in your example, you would get the same result with just: SELECT * FROM people WHERE title ~ 'Mgr'; https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP -- Bien à vous, Vincent Veyron https://marica.fr/ Logiciel de suivi des contentieux juridiques, des sinistres d'assurance et des contrats
В списке pgsql-general по дате отправления: