Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

SQL Syntax for deleting entries

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

freeflow

Established Member
Impact
13
I would like to clean up my database, but I need some help with the syntax for the SQL commands.

Table: Domains2
Column: domainNames
Column: status

1. How can I delete duplicate entries? (domainNames)
2. How can I delete all entries with 1 – 3 letters? (domainNames)
3. How can I delete all entries that have the status “CLIENT UPDATE PROHIBITED”? (status)

Thanks for your help.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Remember to backup your database before trying this out.

For 1 just add a unique index on the domainNames column.

For 2 use:
Code:
DELETE FROM `Domains2` WHERE CHAR_LENGTH(domainNames)<4

For 3 use this:
Code:
DELETE FROM `Domains2` WHERE status LIKE '%CLIENT UPDATE PROHIBITED%'
 
0
Close
sote said:
For 2 use:
Code:
DELETE FROM `Domains2` WHERE CHAR_LENGTH(domainNames)<4

Thanks for your help. Code number 2 is not deleting the entries with
three or less characters. Is it case sensitive?
 
0
Close
just use this:
Code:
DELETE FROM `Domains2` WHERE CHAR_LENGTH(domainNames)<1
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back