Thursday 15 March 2012

MySQL Search for Duplicates across multiple columns -


Apologues : I mean the duplicate should be within the same column.

I have the following code:

  SELECT m. * Select text from the (mytable group) COUNT (*)> 1) text = q.text   

to duplicate it on the column text Enables searching and works fine, however, I have a table:

  q1a, q2a, q3a, q4a, q5a   

me What is the query to check for in duplicate all columns - if it is possible and can give me a hint?

Thanks,

H.

It may be what you want, it will give you repeated text, and which rows And column match;

  SELECT GROUP_CONCAT (id) id, q1a text, 1 from myTable GROUP via text to COUNT (*) & gt; 1 Select Union GROUP_CONCAT (ID), q2a Text, 2 Text Hosting with myTable GROUP COUNT (*) & gt; 1 Select the union from group (*)> 1 union selected GROUP_CONCAT (ID), q4a text, 4 from myTable GROUP, text from group_concat (id), q3a text, 3 to text from myTable GROUP COUNT (*) & Gt; 1 UNION is being selected from GROUP_CONCAT (ID), q5a text, 5 from myTable Group (*) & gt; 1   

.

No comments:

Post a Comment