[advanced search]
Results from the most recent live auction are here.
16 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-09-2008, 03:20 PM   · #1
freeflow
NamePros Member
 
Trader Rating: (0)
Join Date: Dec 2006
Posts: 113
NP$: 12.00 (Donate)
freeflow is on a distinguished road
Question SQL Syntax for deleting entries

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.


Please register or log-in into NamePros to hide ads
freeflow is offline   Reply With Quote
Old 06-09-2008, 11:28 PM   · #2
sote
NamePros Member
 
sote's Avatar
 
Trader Rating: (5)
Join Date: Jul 2006
Posts: 67
NP$: 6.10 (Donate)
sote will become famous soon enoughsote will become famous soon enough
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%'
__________________
woosah!
sote is offline   Reply With Quote
Old 06-10-2008, 02:30 AM   · #3
freeflow
NamePros Member
 
Trader Rating: (0)
Join Date: Dec 2006
Posts: 113
NP$: 12.00 (Donate)
freeflow is on a distinguished road
Originally Posted by sote
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?
freeflow is offline   Reply With Quote
Old 06-10-2008, 02:42 AM   · #4
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (234)
Join Date: Dec 2005
Posts: 19,347
NP$: 18044.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
just use this:
Code:
DELETE FROM `Domains2` WHERE CHAR_LENGTH(domainNames)<1
weblord is offline  
  Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Traffic Down Under EscrowDNS Proof is in the Parking
Advertise your business at NamePros
All times are GMT -7. The time now is 10:47 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0