Join Nostr
2026-01-20 12:51:20 UTC

Jim Spath on Nostr: On a minor spreadsheet to database project, trying to split a single column into ...

On a minor spreadsheet to database project, trying to split a single column into either "cast" or "crew" based on positions ("Stage Manager") and almost forgot NULL equates. #SQL

select
cast_crew,
person,
role
from
cast_cooked
where
role in (
select
role
from
cast_cooked
where
cast_crew = 'crew'
group by role
)
and
cast_crew is NULL
;

Handy pick-up on enum in #PostgreSQL, behind the scenes limits choices: 'cast' or 'crew'.

https://dba.stackexchange.com/questions/329261/making-use-of-enum-in-constraint