Link to home
Start Free TrialLog in
Avatar of mikesung99
mikesung99

asked on

msql merge

Hi,

I have a database table which stores routing information but there are records which I would like to merge.

The schema is as follows
           F1 - VARCHAR(30)
           F2 - VARCHAR(40)
           F3 - VARCHAR(6)
           F4 - DATETIME
           F5 - VARCHAR(40)

An example of a record is as follows:-
         01302,12345,Y,2011-12-05 15:20:28,

The issue is that there may be another record as follows:-
          01302,,Y,2011-12-05 17:25:30,54321  

What we would like to do is somehow merge records, so that for the example above, we would have:-
          01302,12345,Y,2011-12-05 17:25:30,54321

I know that F4 is different but this doesn't matter so much - the main goal is to have records with the same F1 consoldated into 1 record with the F2 and F5 fields merged. In the database table that we've inherited, there is no more than 2 records with the same F1.

We were considering using a SQL command but unsure as to the command to use - any help on this would be greatly appreciated.

Thanks.





ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mikesung99
mikesung99

ASKER

Thanks