Xultron :
I would like to know, how can I build a query that shows me an extra column where instead of showing the true value of the original column it shows me the text that i want?
For example, The Column, in this case "inputOutput", save values 0 or 1, and I would like to show in a query that if the value is 0 I can see the text "Output" and if it is 1 show "Input" in all the rows.
what function or structure could you use?
This is just an example of the columns that I would like to show:
Select idInventory, date, "text that that replaces 0 or 1 from inputOtput column"
from inventory;
GMB :
You can use a case
expression for this:
select
idInventory,
date,
case inputOutput
when 0 then 'Output'
when 1 then 'Input'
else '???'
end status
from inventory;
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=386192&siteId=1