why does it shows truncated incorrect integer values when using char(salary,'$99,999) I tried the following query: 

select 
    concat(e.first_name,"  ",e.last_name) as 'employee name',
    char(s.salary*15/100,'$99,999') as 'No.Of Dollors'
from 
    employees e
join 
    salaries s
    on e.emp_no=s.emp_no 
group by 
    e.emp_no,s.emp_no;


It raises:


  truncated incorrect integer vale:'$99,999'
You are receiving a warning as '$99,999' is not an integer. The CHAR() function expects integer(s) as input. 

As suggested by McNets: it seems you are trying to use the CHAR() function for something it is not intended to do. The CHAR() function accepts integers as input and will interpret each integer as a character code, returning corresponding, concatenated character(s) as a string. 

The function you seem to be looking for is the FORMAT() function, which will format a numerical value and returns a string. This will however not prepend a currency symbol, so that should then be added via the CONCAT() function. 

As suggested by Kumar: the following will produce the result (I expect) you wish to achieve:

SELECT 
    CONCAT(e.first_name,"  ",e.last_name) AS 'employee name',
    CONCAT('$', FORMAT(s.salary*15/100, 2)) AS 'No.Of Dollors'
FROM
    employees e
JOIN
    salaries s
    ON e.emp_no = s.emp_no 
GROUP BY
    e.emp_no, s.emp_no;