| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Simple db table design question
>> Actually in this case I can't guarantee that both home and work
emails are NOT NULL, ... <<
CREATE TABLE Foobar
(name ....
home_email VARCHAR(64),
work_email VARCHAR(64),
best_email CHAR(1) DEFAULT 'h' NOT NULL
CHECK (best_email IN ('h', 'w', 'n')),
...);
SELECT ...,
CASE WHEN best_email = 'h'
THEN home_email
WHEN best_email = 'w
ELSE '{{NONE}}' END AS email,
![]() |
![]() |