Update Query

  • Thread starter Thread starter NEWER USER
  • Start date Start date
N

NEWER USER

I have a table with 4 fields and some duplicate values in Field1. Field2 has
values, but no duplicates. Field3 and Field4 are null at this time.

I want to Group values in Field1, and update Field3 and Field4 with values
in Field2 for the duplicates in Field1. Rather than have four records, I
want one record with 4 columns. Can this be done?
 
I have a table with 4 fields and some duplicate values in Field1. Field2 has
values, but no duplicates. Field3 and Field4 are null at this time.

I want to Group values in Field1, and update Field3 and Field4 with values
in Field2 for the duplicates in Field1. Rather than have four records, I
want one record with 4 columns. Can this be done?

Not sure what you mean by "for the duplicates in field1". Could you give an
example of the existing data and the desired result?
 
Starting Point
Field1 Field2 Field3 Field4
1 2
1 3
1 4

Ending Point
Field1 Field2 Field3 Field4
1 2 3 4

Somehow Group the records on Field1 and Move the values in Field2 to Field3
and Field4. Vertical to Horizontal; I hope this makes it a little clearer.
Transfer column data to row data.
 
Starting Point
Field1 Field2 Field3 Field4
1 2
1 3
1 4

Ending Point
Field1 Field2 Field3 Field4
1 2 3 4

So if you had 58 rows for Field1 = 1 you would want 59 fields, and if you had
5 rows you would want 6 fields? Is there any limit on the number of
duplicates?

Sorry. This is NOT making sense. What business task are you trying to
accomplish? It looks like you're taking a properly normalized table and
grossly denormalizing it!
 
Back
Top