Jump to content

Query for finding duplicate entries


xstevex

Recommended Posts

Hi,

 

I just use phpmyadmin and I've been trying to write a query that selects all "userid"  entries that are entered twice or more.

 

The table has fields: userid (int) and listid (int).

 

On a double entry the userid will be entered twice, once next to list 39 (for example) and a second time next to list 40.

 

Like:

 

userid | listid

1247 | 39

1247 | 40

 

I thought something like "(listid between 0 and 50 and listid between 0 and 50)" in the search conditions would work but it just selects everything.

 

Is there an "andalso" function? Or something else that would work?

 

Steve.

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/88893-query-for-finding-duplicate-entries/
Share on other sites

Thanks guys for the answers,

 

I've tried many combinations of this in phpmyadmin but keep getting errors. Because I think the syntax must be different for there. What I do is I go into phpmyadmin through my website control panel and then click on the table in the database. There you can enter "where conditions" to search the table. I put them inside brackets like the instructions say: ( "where" ).

 

Do you know how I would put this sort of search in the "conditions" in phpmyadmin?

 

Steve.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.