![]() |
|
![]() | ||
|
Subject:
MySQL Programming
Category: Computers > Programming Asked by: mhffs-ga List Price: $5.00 |
Posted:
27 Dec 2002 10:58 PST
Expires: 26 Jan 2003 10:58 PST Question ID: 133974 |
Hi, I have a database: "database1" with a table: "news" In news there is a field: "link" which contains urls. I would like the query that will look at link to see if it contains "http://www.myweb.com/track/track.php?" if it does do nothing. If it does not then I would like to append this to the beginning of the existing URL. I believe the query looks something like this: UPDATE news SET link = 'http://www.MyWeb.com/track/track.php?' + link WHERE link not like '%www.myweb.com/track/track.php?%'; but it isn't producing the proper result. Hope you can help. Thanks, Martin |
![]() | ||
|
Subject:
Re: MySQL Programming
Answered By: webadept-ga on 27 Dec 2002 11:58 PST Rated: ![]() |
Hi, You want to use the concat function for this. Example: update news set link = concat("http://www.myweb.com/track/track.php?", link) where link not like '%www.myweb.com/track/track.php?%'; Thanks, webadept-ga |
mhffs-ga
rated this answer:![]() Thanks. Perfect answer & fast. |
![]() | ||
|
There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |