A Query result is just Numbers and it would be easy to read thru and understand if they are String.
How to mark the String equivalent for a number in the query result.
The Mapping for Numbers vs String has to be in the Query.
select num from table;
Query Result is 9,2,4,7.
String literals are to be mapped to this numbers. the num range is from {0-9}
0-Prepaid, 1 -postpaid like wise
You can use
CASEexpression for this like so:You can do this also using a temp table for example:
Then you can
JOINthe two tables to replace the numbers with the corresponding string:I used
LEFT JOINto giveNULLvalues for the numbers that had no corresponding strings in the other table.Here is a demo in sQL fiddle