As you mentioned above, I defined the columns as unique and im using "select" to check this operation. But it is time consuming, because of our table has nearly 15million records. If there is duplicate while insert, mysql gives error with columns that caused duplicates, instead would it be possible to print the auto incremented column?
For example,
If if insert a record and if it is success then i can use last_insert_id() to get the auto incremented value.
Similarly, if my insert fails because of duplicate , is there any such function to return the already existing value? Just a thought. Because running select again to get that value takes much time
.
Thanks and Regards,
Bala