Jump to content

zeroes not being retrieved from varchar col


peppericious

Recommended Posts

For mobile phone numbers, I have 2 varchar cols, 'prefix' and 'suffix' which contain numbers like:

 

'083'

'085'

'087'

 

.. and:

 

'1234567'

'2345678'

'0987654'

 

... respectively. Now, when I run a select query like:

 

SELECT CONCAT(prefix, '-', suffix) AS mobile FROM table

 

... I'm getting results like:

 

83-1234567

85-2345678

87-987654

 

How can I modify my query so that the '0's (zeroes) are not omitted from the results?

 

TIA.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.