Click here to get back home

double entries

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
double entries windandwaves 03-24-2007
Get Chitika Premium
Posted by windandwaves on March 24, 2007, 3:34 pm
Please log in for more thread options
Hi Folk

I have a databse with a bunch of double entries in some fields. For
example:


field A:

"that is the way to go that is the way to go "

field A should be:

"that is the way to go "

Is there some sort of sql I can use to find these (and clean them up)?

TIA

> Nicolaas


Posted by strawberry on March 25, 2007, 5:11 am
Please log in for more thread options
> Hi Folk
>
> I have a databse with a bunch of double entries in some fields. For
> example:
>
> field A:
>
> "that is the way to go that is the way to go "
>
> field A should be:
>
> "that is the way to go "
>
> Is there some sort of sql I can use to find these (and clean them up)?
>
> TIA
>
> > Nicolaas

> Is there some sort of sql I can use to find these
Yep. Assuming they really are exact doubles (phrase,space,phrase)
here's one way:

SELECT TRIM( SUBSTR(
fieldA, 1, FLOOR( LENGTH( fieldA ) /2 ) )
)
START , TRIM( SUBSTR(
fieldA, CEILING( LENGTH( fieldA ) /2 ) )
)finish
FROM mytable
HAVING START = finish
LIMIT 0 , 30

>(and clean them up)?

I'll leave that as an execise for the reader. WARNING: BACK UP YOUR
DATA BEFORE YOU ATTEMPT THIS!!!


Similar ThreadsPosted
Single & Double Quotes August 18, 2005, 1:05 pm
accounting apps, use Decimal, Int, or Double ? November 28, 2005, 3:24 pm
Trying To Avoid Two Database Calls... (Double-Post) October 11, 2006, 11:18 am
Searching in Boolean mode with double quotes far too slow June 26, 2006, 12:59 pm
Replacing all entries with "Re:" October 27, 2005, 3:22 pm
Best way for finding duplicate entries in table? June 1, 2005, 4:25 am
making a table with unique entries October 11, 2005, 11:44 am
Search for entries starting with a non-letter? January 26, 2006, 5:54 pm
Need your help to remove spaces in the column entries using SQL October 21, 2006, 12:02 pm
Saving storage space on blank entries in DB October 31, 2005, 2:10 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap