BWSnippet

Select With Pad

Select With Pad

Want to pad a field while selecting using mysql?

This pads a field to length of 18 with 0s for any char that does not currently exist in the table field.

SELECT LPAD(  field  , 18, '0' ) FROM table WHERE some_field_id=3198

Tags

Select With Pad