I'm currently using _mysql library in python.
it uses pkey(int, auto increment) value that's created when inserting data using function conn.insert_id()
This is how the query is made. INSERT INTO ... (...) VALUES (...) ON DUPLICATE KEY UPDATE ...
It needs to get the corresponding pkey value when updated (it's a query that is updated when data piles up)
the problem occurs when the data is duplicated, (because of the unique key) the return value of conn_insert_id() is 0. (the problem doesn't occur when data is inserted)
the current solution I have is to retrieve pkey through a function that selects corresponding pkey when the return value is 0 for conn_insert_id(), but I want to know if it's possible to get pkey with out a separate select query?