Title: search duplicate value on database
Last modified: December 5, 2020

---

# search duplicate value on database

 *  [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-duplicate-value-on-database/)
 * on wp-usermeta I have some mobile value which duplicates.
 *     ```
       user id     metakey     meta value
       1            mobile        001912
       1            mobile        001912
       ```
   
 * I want to write a SQL command to select and see a list from all users who have
   a duplicate number(with username).

Viewing 1 replies (of 1 total)

 *  [Vlad](https://wordpress.org/support/users/vladytimy/)
 * (@vladytimy)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/search-duplicate-value-on-database/#post-13749492)
 * Hi, [@mohammad983](https://wordpress.org/support/users/mohammad983/)!
 * Try this: _I used the fields and table name stated above. Feel free to change
   them if needed. _
 *     ```
       SELECT 
           user_id,    COUNT(user_id),
           metakey,    COUNT(metakey),
           meta_value, COUNT(meta_value)
       FROM
           wp-usermeta
       GROUP BY 
           user_id, 
           metakey, 
           meta_value
       HAVING  
           COUNT(user_id) > 1
           AND COUNT(metakey) > 1
           AND COUNT(meta_value) > 1;
       ```
   
 * Hope this helps.

Viewing 1 replies (of 1 total)

The topic ‘search duplicate value on database’ is closed to new replies.

## Tags

 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Vlad](https://wordpress.org/support/users/vladytimy/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/search-duplicate-value-on-database/#post-13749492)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
