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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -