MySQL Forums
Forum List  »  Newbie

Re: Help with Select Distinct
Posted by: Peter Brawley
Date: November 03, 2016 02:50PM

If you can prove that only one column differs for each duplicated reportGuid, and supposing the column is named `abc, then to normalise your table and preserve the data, project the multiple values to a child table ...

create table abc select reportGuid,abc from actions;

alter table abc add primary key(reportGuid,abc);

alter table actions drop column abc;

If there are multiple such columns, do the above with those columns.

Options: ReplyQuote


Subject
Written By
Posted
November 03, 2016 12:25PM
November 03, 2016 01:45PM
November 03, 2016 02:08PM
Re: Help with Select Distinct
November 03, 2016 02:50PM
November 03, 2016 04:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.