Friday, 6 September 2013

Finding duplicates in MYSQL table where data is in "title" -> "value" columns

Finding duplicates in MYSQL table where data is in "title" -> "value" columns

Given I know the basics of MYSQL I would appreciate help with the following:
table -> subrecords schema
id | record | element | title | name | type | value
The table stores data submitted via a web form. Each row is one field the
"record" is the field that identifies each unique submitted form, the
title of the form is stored in another table:
table -> records schema
id | submitted | form | title | name
I need to find all users (by email) that submitted the form more than
once, I can't quite get the logic straight, I assume I would:
SELECT * from subrecords WHERE record as id in records AND title (in
records) = form-name
then process everything selected so that I can find duplicate emails, the
emails are in subrecords table where title = "email" and value =
some@email.com
I hope this was clear enough, these tables don't have the easiest
structure to work on for me.
Thank you

No comments:

Post a Comment