postgresql - Change out put of query result dynamically in sql -
i have table called test this:
label value ------------ yes 01 no 02
when run query select option 'yes';
select label table_name value = '01';
for query i'll answer 'yes'. trying change label 'yes, have'...
it should returned query... idea this??? can change label while returning data query..???
use case
expression:
select case when label = 'yes' 'yes, have...' else label end label, value table_name value = '01'
this query replace 'yes'
value label
column 'yes, have...'
, value remain same otherwise.
Comments
Post a Comment