Jump to content

finding duplicate values in database


TheTitans

Recommended Posts

I have two columns in a mysql table called evo_chain_id and evo_parent_id. They look like this:

 

mysqltable.png

 

I would like to check if two or more values in evo_parent_id are the same. If they are, execute one function. If not, execute another function. So, for example, because 265 appears in there more than once, the first function would execute. I think I'm suppose to do something with the SQL COUNT() function, but I'm not too sure how that works. Could some help me?

Link to comment
Share on other sites

if you want them to be unique just assign the column auto_increment

 

if you dont want them to be unique

 

do a select call to search the table against the id before you call a function then depending on the mysql_num_rows you get back you can then decided to call which function.

Regards

Mark

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.