mysql retrieve duplicate entry

Posted by Cypher on Stack Overflow See other posts from Stack Overflow or by Cypher
Published on 2010-03-23T23:50:19Z Indexed on 2010/03/23 23:53 UTC
Read the original article Hit count: 374

Filed under:
|
|

I have a huge text file that I'm importing into a mysql database. The four important tables that I'm using are -->
schools (id,name)
variables (id, name)
var_entries (id, var_id, data) with unique( var_id, data)
data (id, school_id, var_ent_id)

I have a file that I'm importing into this database. I want every variable to have a unique set of values (hence the unique call) but I also then want to associate the appropriate var_entrie with a school in data. So my question is is there a way to get the appropriate var_ent_id when you a duplicate var_entry is added? I know I can do this with storing the values and using a strcmp but it'd be messy.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about retrieve