Re: Help w/ data modeling, 1 to 1, 1 to none? hack?
Posted by: Rick James
Date: February 07, 2009 05:06PM

Turn it around. Put paper.id into the fsc table (as, say, fsc.paper_id). You can either have a flag in paper that says it is FSC certified, or you could have nothing. To fetch the fsc certification stuff (or NULL if it is not certified), use
SELECT paper..., fsc...
   paper LEFT JOIN fsc ON paper.id = fsc.paper_id
The fsc fields will be NULL if not certified.
Or, if you add
WHERE fsc.paper_id IS NULL
you can get only the non-certified ones.
Or, us JOIN (not LEFT JOIN) to get just the certified ones.

Options: ReplyQuote


Subject
Written By
Posted
Re: Help w/ data modeling, 1 to 1, 1 to none? hack?
February 07, 2009 05:06PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.