public inbox for [email protected]
help / color / mirror / Atom feedRe: Selecting all variations of job title in a list
2+ messages / 2 participants
[nested] [flat]
* Re: Selecting all variations of job title in a list
@ 2025-11-25 16:49 Ron Johnson <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Ron Johnson @ 2025-11-25 16:49 UTC (permalink / raw)
To: pgsql-generallists.postgresql.org <[email protected]>
On Tue, Nov 25, 2025 at 11:33 AM Rich Shepard <[email protected]>
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?
>
Maybe regex_match() with a bunch of OR clauses.
In bash, I'd do something like:
grep -E ' ^Asst Gen Mgr.*|^Env Mgr.*|^Gen Mgr.*|^Mgr.*|^Plant Mgr..*'
foo.txt
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Selecting all variations of job title in a list
@ 2025-11-25 19:05 Rich Shepard <[email protected]>
parent: Ron Johnson <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Rich Shepard @ 2025-11-25 19:05 UTC (permalink / raw)
To: [email protected]
On Tue, 25 Nov 2025, Ron Johnson wrote:
> Maybe regex_match() with a bunch of OR clauses.
>
> In bash, I'd do something like:
> grep -E ' ^Asst Gen Mgr.*|^Env Mgr.*|^Gen Mgr.*|^Mgr.*|^Plant Mgr..*'
> foo.txt
Ron,
I've not used regex in postgres before, only in emacs and small languages.
So I'll learn how to do this. I was trying to avoid multiple OR clauses, but
that script will not be run often so it should not matter.
Thanks,
Rich
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-11-25 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-11-25 16:49 Re: Selecting all variations of job title in a list Ron Johnson <[email protected]>
2025-11-25 19:05 ` Rich Shepard <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox