hocuspocus31
hocuspocus31

Reputation: 183

Add percent symbol as int

Is it possible to add the percent symbol as an int? Because when I try to use concat it changes the other numbers into string and i'm trying to avoid that.

The structure of the query i have is like this:

SELECT <First Query>
UNION ALL
SELECT CONCAT('5', '%')...

Output becomes:

 1000
 5%

Initially, i'd like to keep the comma on the first output so it will be like

 1,000
 5%

Is there an easier way I can achieve this? I hope this made sense.

Thank you.

Upvotes: 0

Views: 301

Answers (1)

Rahul Tripathi
Rahul Tripathi

Reputation: 172448

You cannot add % symbol without changing the type to string. So what you are doing is by far the best way to proceed with ie, you need to cast the int as string and then concatenate the % symbol to it.

Upvotes: 1

Related Questions