Take the 2-minute tour ×
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. It's 100% free, no registration required.

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.

1  
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
1  
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.