Question

I am trying to display one column name with '%' i.e the "ip_utilization" column as "usage%" column here. But i am not able to, can anyone suggest a solution please. I am sharing the query.

select ip_name, concat (first_name, ' ' ,last_name) as Contact, ip_utilization as usage_% from database_name;
Was it helpful?

Solution 2

Enclose usage_% in `` as below:

select ip_name, concat (first_name, ' ' ,last_name) as Contact, ip_utilization as `usage_%` from database_name;

If you have further problems, leave a comment.

OTHER TIPS

Just give it a different column name? Like usage_percentage.

It may be possible to have the percent sign using backticks, but to what end? What point is there in jumping through hoops to somehow have a weird special character in a name that usually won't be displayed in an application anyway?*

(Unless it's really a public-facing app and you can't change the name on application level at all. But that should be the rare exception.)

You should be able to use backticks

select ip_name, concat (first_name, ' ' ,last_name) as Contact, ip_utilization as `usage_%` from database_name;

Quote usage%. But I advice to change the name, because % is keyword used for like command.

select ip_name, concat (first_name, ' ' ,last_name) as Contact,
ip_utilization as 'usage_%' from database_name;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top