Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Should I denormalize this?
I am looking at this problem and I don't know how to handle it other
than de-normalizing the table. Here is a simple table:
Case # Defendant -------- -------------- 123 Shell 123 Arco 123 Exxon
Here is how I need the results to be in two different scenarios:
Scenario #1) "Bring me all case numbers that have Shell AND Arco in
them." Here, it would output case # 123
Scenario #2) "Bring me all case numbers that have Shell AND Union 76 in
them." Here, it should return an empty set since Union 76 is not a
company associated with any case.
I am not sure how to handle this. I was thinking about de-normalizing teh table and listing one record per case and all the defendants will be listed in a single field separated by a token like: "Shell~Arco~Exxon" and then doing a SELECT Case WHERE Defendant LIKE "Arco" AND Defendant LIKE "Shell" or whatever, but I am wondering if there is a more elegant way.
![]() |
![]() |