Re: Selecting all variations of job title in a list

Adrian Klaver <adrian.klaver@aklaver.com>

From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Rich Shepard <rshepard@appl-ecosys.com>, pgsql-general@lists.postgresql.org
Date: 2025-11-25T16:53:15Z
Lists: pgsql-general
On 11/25/25 08:33, Rich Shepard 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.


Something like?:

select 'Env mgr.' ilike  ANY(ARRAY['Asst Gen Mgr.', 'Env Mgr.', 'Gen 
Mgr.', 'Mgr.','Plant Mgr.']);

t
> 
> Is there a way to use a multicharacter wildcard in an 'in' list?
> 
> TIA,
> 
> Rich
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com