Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MySQL Query Help

Posted on 2012-04-04
2
Medium Priority
?
360 Views
Last Modified: 2012-04-04
Ok,

So I have a table, with field 'short' that contains shortened version of urls.
Right now row['short'] on each row would outuput links like this:
on.fb.me/zzV01q

But I want it to output:
bit.ly/zzV01q

So I tried this:
update videos2 set short = replace(short, ‘on.fb.me’, ‘bit.ly’) WHERE length('short') > 0

Open in new window


But It gives me error:
#1054 - Unknown column '‘on.fb.me' in 'field list'

short is a varchar(30)       utf8_general_ci        by structure.
0
Comment
Question by:GVNPublic123
2 Comments
 
LVL 21

Accepted Solution

by:
oleggold earned 2000 total points
ID: 37808297
try
 update videos2 set short = replace(short, "on.fb.me", "bit.ly") WHERE length('short') > 0
0
 

Author Comment

by:GVNPublic123
ID: 37808318
That worked. Stupid semicolons.
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
The viewer will learn how to count occurrences of each item in an array.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question