1. Jonathan Ashwell
  2. Valentina Database ADK
  3. Dienstag, Januar 19 2016, 08:37 PM
  4.  Abonnieren via E-Mail
I'm trying to find a simple way to identify any duplicates I have in a text field "uuid". (The field is not flagged as unique, I'm managing this myself). Is there a simple way to search for all records where the field "uuid" is not unique so I can find duplicates? Or must I loop through all the records and search for the uuid and see if there is more than one hit?

Jon
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
select group_concat( recID ) from t1 group by "uuid"

to get the list of recID for each uuid value. If you get the single row, then your uuid us unique.
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
Note that ORDER BY, GROUP BY commands, will produce index file for that field anyway.
Kommentar
There are no comments made yet.
Jonathan Ashwell Akzeptierte Antwort
Thank you. Is it possible to just get those records with more than one uuid? Something like this?

select uuid from t1 group by uuid having Count(*) > 1
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Sure, but you technically need to mention count(*) in select list:

select count(*) as c, group_concat( recID ) from t1 group by uuid having c > 1
Kommentar
There are no comments made yet.
Jonathan Ashwell Akzeptierte Antwort
Thank you very much, Ivan.
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories