If the status field records code, for example, "Y" means "Completed" and "N" means "Not Completed"
The status expressed using only SQL statements is as follows:
SELECT FILE,CASE FILESTATUS
WHEN 'Y' THEN 'Completed'
WHEN 'N' THEN 'Unfinished' END AS FILESTATUS
FROM TBFILE
Note: If it ends with END
, if it is a DATAGRID binding field, the above writing method will cause problems, and the status field cannot be bound. It should be written like this:
SELECT FILE,FILESTATUS =CASE
WHEN FILESTATUS ='Y' THEN 'Completed'
WHEN FILESTATUS ='N' THEN 'Not completed'
END FROM TBFILE