Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say that I have a VARCHAR (which contains numeric data) that I want to use for a simple computation (adding 10 to it). According to the MySQL documentation on CAST functions, I could accomplish this with either a CAST or a CONVERT:

SELECT (CAST(field1 AS SIGNED)) + 10
FROM myTable;


FROM myTable;

What is the difference between CAST and CONVERT in this sense? Are they both really accomplishing the same thing?

share|improve this question
up vote 7 down vote accepted

Yes, CAST and CONVERT to the same thing, except that CONVERT allows more options, such as changing character set with USING.

share|improve this answer
Is there a kind of performance difference o something like that... i meant there's must be a difference.. – user7479 Mar 15 '12 at 22:48

Convert and cast docs. Aside from the syntax I believe they can functionally be considered synonyms, even when trying to change character sets.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.