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

I have a query am working on where I want to Trim a leading character and the concat other three characters my query is as follows

SELECT CONCAT ('255', TRIM(LEADING '0' FROM `mobile`) 
FROM subscriptions 
where `group_id`= news;

The mobile column has number that start with 0 and I would like to remove the 0 and add the 255 to it when I try to run the query I get an error what am I doing wrong.

share|improve this question

closed as too localized by JNK Aug 15 '12 at 16:57

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

You have a parenthesis missing. – ypercubeᵀᴹ Aug 15 '12 at 11:56
i feel so stupid thanks @ypercube worked like clock work – Sitati Aug 15 '12 at 11:58
Also notice that TRIM will remove all leading 0s, if it is one, two, three or a hundred 0s. – ypercubeᵀᴹ Aug 15 '12 at 11:59

Browse other questions tagged or ask your own question.