Leading Zero MySQL Perspective Table

Hey guys,

As always I appreciate any help. I have a perspective table. It’s cutting off leading zero on a simple select query. Colum is zero-filled in the table. Do I need to Lpad() the query? Can’t get it to work in query currently. But shouldn’t the table have the exact values from sql table?

Is the data type of the database column a string type or a number type?

If it’s a string type, just set the table column’s render property to string.

If it’s being stored as a number then yes, you’ll need to left pad it yourself and again, set the column render property to string.

EDIT: I can see now that you didn’t actually set up any of your columns in the table, you just let them be handled automatically. You’ll need to manually add the columns in the table component and set them up so that the first column is rendered as a string, because right now it’s automatically detecting that it’s a number. And again, if the data is being brought in as a number, you’ll have to left pad it yourself - probably through a scripting transform.

1 Like

It was an INT(3). Its now a String(3). Thanks man!!

1 Like

I was also going to suggest using ZEROFILL(), but I see that’s deprecated in MySQL 8-point-something. :shakes fist at MySQL:

1 Like

Lol. Good to know going forward. Because it was zero filled. Or was before it was changed to varchar. Thanks!