>Hello,
>
>
>I have a table which consists of 5 columns.
>There are a large number of rows that have the same values for the
>first 4 columns and the last column is the only thing that differs.
Sir, this can be interpreted two different ways. Either
col1=col2=col3=col4, or row1.col1=row2.col1, row1.col2=row2.col2,
osv. You already gotten a response from someone who interprets it the
first way.
>I would like to grab all the rows that have these identical
>columns so I can store it into one rows with all the different
>values in the last column of just one row. What would the syntax
This makes it sound like you mean it the second way, so I'll
interpret it that way.
>be to grab all the rows that have identical data in
>the first 4 columns? I know this is pretty trivial but everthing
>I try seems to be wrong. Thanks for your help.
>
>
>Greg
You can do that by grouping on the first four rows. This eliminates
duplicates in the first four rows.
It sounds as though your first four columns constitute an intelligent
key or superkey. If so, your current design violates 2NF and your
proposed design violates 1NF. A better solution is probably to create
a second table with a many-to-one relationship with the existing
table, and put the fifth column into the second table.
Bob Hall
Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php