473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Replacing all entries with "Re:"

Ok here's the thing... I have a vBulletin forum database... there is a
table in there called "post" which has all of my forums posts in it.

What I have are many posts with regular titles like "Oh hello how are
you" or whatever, and many posts (which are replies) with "Re:" before
them and whatever message following that.

I have recently updated my forums not to show the Re: thing, and I need
a quick way to execute a query or something that will CLEAR all titles
that have this "Re:" in the title area of the post table entries.

Anyone know how I can do this?

The table is called "post" and the cell (?) I guess is called "title."

There are over 8,000 entries in this post table so I really need to
find an efficient way to remove all of the titles with "Re:" ...
manually is just too long and too hard.

Thanks for your help.... by the way I'm running MySQL version 4.0.25 I
believe.

Oct 27 '05 #1
14 1635
<ss******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Ok here's the thing... I have a vBulletin forum database... there is a
table in there called "post" which has all of my forums posts in it.

What I have are many posts with regular titles like "Oh hello how are
you" or whatever, and many posts (which are replies) with "Re:" before
them and whatever message following that.

I have recently updated my forums not to show the Re: thing, and I need
a quick way to execute a query or something that will CLEAR all titles
that have this "Re:" in the title area of the post table entries.

Anyone know how I can do this?

The table is called "post" and the cell (?) I guess is called "title."

There are over 8,000 entries in this post table so I really need to
find an efficient way to remove all of the titles with "Re:" ...
manually is just too long and too hard.

Thanks for your help.... by the way I'm running MySQL version 4.0.25 I
believe.

Well - what is it you want to do? It helps to be specific!
It is unclear whether you are trying to query or you wish to actually modify
the data in your table.

------------------------------------
Query for only titles that don't begin "Re:"

SELECT title
FROM post
WHERE NOT (title LIKE 'Re:%')
------------------------------------------
Query all titles but hide the leading "Re:"

SELECT title
IF (LEFT(title,3)='Re', RIGHT(title, LENGTH(title)-3), title) As
AdjustedTitle
FROM post
--------------------------------------------
Surely you didn't mean to delete those records when you said "CLEAR"

DELETE FROM post
WHERE title LIKE 'Re:';

------------------------------------------------
Or perhaps you meant to keep the records but remove the leading "Re:" from
[titles] in the table post !

UPDATE post
SET title = LEFT(title,3)='Re', RIGHT(title, LENGTH(title)-3)
WHERE title LIKE 'Re:';
---------------------------------------------------------

Thomas Bartkus
Oct 28 '05 #2
<ss******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Ok here's the thing... I have a vBulletin forum database... there is a
table in there called "post" which has all of my forums posts in it.

What I have are many posts with regular titles like "Oh hello how are
you" or whatever, and many posts (which are replies) with "Re:" before
them and whatever message following that.

I have recently updated my forums not to show the Re: thing, and I need
a quick way to execute a query or something that will CLEAR all titles
that have this "Re:" in the title area of the post table entries.

Anyone know how I can do this?

The table is called "post" and the cell (?) I guess is called "title."

There are over 8,000 entries in this post table so I really need to
find an efficient way to remove all of the titles with "Re:" ...
manually is just too long and too hard.

Thanks for your help.... by the way I'm running MySQL version 4.0.25 I
believe.

Well - what is it you want to do? It helps to be specific!
It is unclear whether you are trying to query or you wish to actually modify
the data in your table.

------------------------------------
Query for only titles that don't begin "Re:"

SELECT title
FROM post
WHERE NOT (title LIKE 'Re:%')
------------------------------------------
Query all titles but hide the leading "Re:"

SELECT title
IF (LEFT(title,3)='Re', RIGHT(title, LENGTH(title)-3), title) As
AdjustedTitle
FROM post
--------------------------------------------
Surely you didn't mean to delete those records when you said "CLEAR"

DELETE FROM post
WHERE title LIKE 'Re:%';

------------------------------------------------
Or perhaps you meant to keep the records but remove the leading "Re:" from
[titles] in the table post !

UPDATE post
SET title = LEFT(title,3)='Re', RIGHT(title, LENGTH(title)-3)
WHERE title LIKE 'Re:%';
---------------------------------------------------------

Thomas Bartkus


Oct 28 '05 #3
Hey Thomas!
Thanks for helping me out

heres what I need to do

I have a table, called post, and theres a section called "title" ....
tons and tons of titles on all my entries, but I want to clear out all
the titles that contain "Re:" in them so that only ones without "Re:"
remain.

Your help is greatly appreciated!

Oct 28 '05 #4

<ss******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hey Thomas!
Thanks for helping me out

heres what I need to do

I have a table, called post, and theres a section called "title" ....
tons and tons of titles on all my entries, but I want to clear out all
the titles that contain "Re:" in them so that only ones without "Re:"
remain.

Your help is greatly appreciated!


Tables don't have "section"s. I believe you meant "field" or "column" and
your goal is to delete all records (rows) where the entry in the title
(column=field) begins with "Re:".

If this is so, you already have it:

DELETE FROM post
WHERE title LIKE 'Re:%';

Bang! They're gone.
No more records (rows!) where the title begins with "Re:".

AND no way to "undo" unless you have a backup!
Thomas Bartkus

Oct 28 '05 #5
Thomas..... you are my hero. If there is any way I can repay you let me
know. If you have a site or service, I will def. help advertise.

Theo

Oct 28 '05 #6
http://img483.imageshack.us/img483/8664/okok4da.jpg

Please see that screenshot

My goal is to erase the titles that have "Re:" in them.

Thanks again for your help man!!

Oct 28 '05 #7
But remember I still want to keep the actual entries in post... all of
them.

Oct 28 '05 #8
I was interested in your previous replies and saw this suggestion you
made, Thomas:
Or perhaps you meant to keep the records but remove the leading "Re:"
from
[titles] in the table post !

UPDATE post
SET title = LEFT(title,3)='Re', RIGHT(title, LENGTH(title)-3)
WHERE title LIKE 'Re:%';

Perhaps a modification of that would allow keeping the records but
moving the entire title, which is exactly what I want to do with the
titles containing Re:

Thanks so much again
Theo

Oct 28 '05 #9
I was interested in your previous replies and saw this suggestion you
made, Thomas:
Or perhaps you meant to keep the records but remove the leading "Re:"
from
[titles] in the table post !

UPDATE post
SET title = LEFT(title,3)='Re', RIGHT(title, LENGTH(title)-3)
WHERE title LIKE 'Re:%';

Perhaps a modification of that would allow keeping the records but
removing the entire title, which is exactly what I want to do with the
titles containing Re:

Thanks so much again

Theo

Oct 28 '05 #10
<ss******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
But remember I still want to keep the actual entries in post... all of
them.


Dang! Here we go again.

This sounds like you want to *keep* all rows (records!) but simply remove
the "Re:" that appears in front of some of the [title] strings - leaving the
remainder of the [title] string intact.

If *this* is the case then:

UDPATE post
SET title = TRIM(MID(title, 4, 255))
WHERE title LIKE 'Re:%'

Again - if you screw up without a backup - you're screwed! That command is
irrevocable.

Damn computers will do exactly what you tell them but seldom what you want
:-)
You do have a backup - don't you?
Thomas Bartkus
Oct 28 '05 #11
<ss******@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Thomas..... you are my hero. If there is any way I can repay you let me
know. If you have a site or service, I will def. help advertise.

Theo


Send beer!
Thomas Bartkus
Oct 28 '05 #12
Hey Thomas...

See this link real quick if you could!
http://www.vbulletin.com/forum/showthread.php?t=161023

Marco says

UPDATE post set title = ''
WHERE title LIKE 'Re: %'
AND parentid <> 0;
And I want to keep ALL entries/record in the POST table, just want to
simply erase all titles (REMOVE ALL TITLES) from those entries that
have "Re:" in the title.... all of the re:s I want to remove are in the
very beginning too by the way.

If you could suggest an alternative or verify that above post on
vbulletin.com that would be AWESOME!

thanks !!!

Oct 28 '05 #13
"Thomas Bartkus" <th***********@comcast.net> wrote in message
news:Vp********************@telcove.net...
<ss******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
But remember I still want to keep the actual entries in post... all of
them.
Dang! Here we go again.

This sounds like you want to *keep* all rows (records!) but simply remove
the "Re:" that appears in front of some of the [title] strings - leaving

the remainder of the [title] string intact.

If *this* is the case then:

UDPATE post
SET title = TRIM(MID(title, 4, 255))
WHERE title LIKE 'Re:%'

Again - if you screw up without a backup - you're screwed! That command is irrevocable.

Damn computers will do exactly what you tell them but seldom what you want
:-)
You do have a backup - don't you?
Thomas Bartkus


Or if you want to keep each row but clear the entire [title] if it begins
"Re:"

UPDATE post
SET title = ""
WHERE title LIKE 'Re:%'

Irrevocable! Same caveats apply.

You could also set title = Null providing your table definition permits
Nulls here.
Thomas Bartkus
Oct 28 '05 #14
awesome... figured it out..thanks for all the help!

Oct 29 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sander Tekelenburg | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The HTML specs speak of "replaced" and "non-replaced" elements, yet for the life of me I can't find an explanation of what "replaced" is supposed...
14
by: Jeffery Tyree | last post by:
A friend is developing a Access 2003 database. I am developing a simple installer package using C#Net. We are looking for best methods, suggestions and definately code examples for: 1. Setting...
2
by: mark | last post by:
How can I use "Group By" or a formula to group my query results in 1-year periods from a given date, e.g. 3 groups: 1 Sept 2001 - 1 Sept 2002 1 Sept 2002 - 1 Sept 2003 1 Sept 2003 - 1 Sept 2004 ...
1
by: ian.davies52 | last post by:
I'm having a problem running a query. I get the "too many fields" error message, but I only have 162 fields in the query and I thought the limit was 255. The problem query (Query1) is based on...
4
by: MLH | last post by:
I get something like this a percentage of the time when I open an A97 report by dbl-clicking it in the database window. I can not remember seeing tnis when the report is opened in code, I can not...
6
by: Dan | last post by:
I wish to replace all the occurrances of " with &quot; within a string. I have tried using myString.Replace("\"", "&quot;"), but this does not work Any suggestions will be greatly appreciated ...
1
by: Anurag | last post by:
Hi, I have 2 related questions. DB2 UDB ESE v8.x (8.1 till 8.2 FP2 - all fixpaks included) on AIX 5.4.x _____________________________________________________________________________ (QUESTION 1)...
1
by: yoram.ayalon | last post by:
Hello, we have this situation. web farm, several server 2003 machines, and several win2K, SP 4 machines all machines access files on a Network appliance using CIFS I am testing a ASP.NET...
2
by: GB | last post by:
I the Start page of the VS 2005 IDE, I would like to be able to delete obsolete entries in "Recents projects" list, but I dont find any way todo it. Any suggestion?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.