Gossamer Forum
Home : General : Databases and SQL :

How to ?

Quote Reply
How to ?
Hi

How would I go about updating the column "Country" with the data in the URL column.

ie: I want to select all records that have the .com.au in the URL column and add Australia to the column "Country" in those same records.

Same with .com.ca - Canada .com.it - Italy etc etc

Using Links SQL 2.10 on a MS SQL 7 Server.

Thanks

Regards

minesite
Quote Reply
Re: [minesite] How to ? In reply to
Do you mean something like:

UPDATE Table SET Country = 'Australia' WHERE URL LIKE '%.com.au'

?

Last edited by:

Paul: Apr 17, 2002, 6:31 AM
Quote Reply
Re: [Paul] How to ? In reply to
Paul, this must rate as one of the quickest reply's.

I think it should do it, would it also grab the URL's that are

.com.au/index.html ? or just ones that have .com.au at the end ?

Thanks

Regards

minesite
Quote Reply
Re: [minesite] How to ? In reply to
To catch *.com.au/* try;

UPDATE Table SET Country = 'Australia' WHERE URL LIKE '%.com.au%'

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] How to ? In reply to
Thanks Andy, much appreciated. ( 2 mins )

Another quick one, is this relevant to our usage with Links SQL


Start transaction;




UPDATE Table SET Country = 'Australia' WHERE URL LIKE '%.com.au%'

Rollback work;

Commit work;


Regards

minesite

Last edited by:

minesite: Apr 17, 2002, 7:17 AM
Quote Reply
Re: [Andy.] How to ? In reply to
Thanks, All, for this thread. I'm learning more and more about mysql, and it's great. Smile

------------------------------------------