Home > database >  SQL comments
SQL comments

Time:11-08

When using SQL queries need to reduce the value of 0150118579555 '0' numerical display as "completed", so the rest of the numerical display, could you tell me how to write the grammar,

Thank you very much!

CodePudding user response:

Add a case when judging
Case the when field=0 then 'completed' else rtrim (field) end

CodePudding user response:

The select case=0 then the when field 'completed' else cast (field as varchar (10)) from table

CodePudding user response:

The
reference 1/f, February 16 response:
add a case when judging
Case the when field=0 then 'completed' else rtrim (field) end


Thank you, have already according to your grammar,

CodePudding user response:

Case field when '0' then 'completed' else fields end field name
  • Related