I have a table with name, gender and address. Gender is stored as integer, 1 for male, and 2 for female. Now when I want to show the table, in PHP, during drawing the table I check for gender with (if -- else ) and change the (1,2) output into human language ("Male","Female").
Is there a way to do this formatting in the SQL query itself ? so that the query result are already formatted with 'male' and 'female' values.
(I need this to create a view of the formatted table, which I need to use it in DataTable ServerSide processing, so that when I can search in the view for "male", otherwise searching in original table for male shows 0 findings, because it is "1", not "male" ).