Tomas Karlsson wrote:
>
> Hi,
>
> I have a table with these fields: name, cat1,cat2,cat3, where cat1-3 refers to a job
> category (one record per name). I am trying to figure out how to write the SELECT
> statement so that if the person has filled out more than one category that would
> result
> in more than one row by SELECT. For instance, if cat1,cat2 and cat3 all have values
> (not NULL) for a certain name, that would give me 3 rows that I then can sort with
> SELECT. Am I wrong assuming that a single SELECT can return more than one row
> per record?
>
> Thanks in advance!
>
> Tomas
The best solution in your situation is to bring your table to the third
normal form. I cannot tell you very much detail, because cat1-3 is is
the only thing I know about your table. The idea is that you should
design your table is such a way that if one person has a relationship
with more than one category, you would have a row per category. You
should probably have a separate person_cat table, and join it with the
main one when needed.
--
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)