July 25th, 2013, 03:52 AM
Trim leading 0 on macthing rows
I want to remove a leading 0 from all rows that math '00.%'
I would like the above to be
I have tried this
and get this error
update table set telnum = trim(leading '0' from telnum where telnum like '00%')
ERROR: syntax error at or near "where"
Last edited by bboy154; July 25th, 2013 at 04:04 AM.
July 25th, 2013, 04:01 AM
Take a close look at the parentheses.
Originally Posted by bboy154
July 25th, 2013, 04:04 AM
the parentheses was a typo please see now.
Originally Posted by Jacques1
July 25th, 2013, 04:08 AM
It's still the parentheses. There's no such thing as
I guess you mean
trim(leading '0' from telnum where telnum like '00%')
telnum = TRIM(LEADING '0' FROM telnum)
telnum LIKE '00%'
You should start formatting your queries, because this will make syntax errors like this one much easier to see.
July 25th, 2013, 04:14 AM
Thanks Jacques1, I am new to SQL, but I will take you excellent advise about formatting