Case used in SQL Query Any Sugestios?
Posted: 2023-07-22 08:06
Field VarChar= `Reg_Determinari`.`RH_D - OPTION LIST (Pozitiv;;Negativ;;Incert;;_______;;D Slab)
Field VarChar= `Reg_Determinari`.`D`
Query:
SELECT `Reg_Determinari`.`RH_D`, `Reg_Determinari`.`D`
CASE
WHEN`Reg_Determinari`.`RH_D` = 'Pozitiv' THEN 'D'
WHEN`Reg_Determinari`.`RH_D` = 'Negativ' THEN 'd'
WHEN`Reg_Determinari`.`RH_D` = 'Incert' THEN 'D(incert)'
WHEN`Reg_Determinari`.`RH_D` = 'D Slab' THEN 'D(Slab)'
WHEN`Reg_Determinari`.`RH_D` = '_______' THEN ''
END AS `Reg_Determinari`.`D`
FROM `Reg_Determinari`
WHERE `Reg_Determinari`.`ID`='%ID%'
Field VarChar= `Reg_Determinari`.`D`
Query:
SELECT `Reg_Determinari`.`RH_D`, `Reg_Determinari`.`D`
CASE
WHEN`Reg_Determinari`.`RH_D` = 'Pozitiv' THEN 'D'
WHEN`Reg_Determinari`.`RH_D` = 'Negativ' THEN 'd'
WHEN`Reg_Determinari`.`RH_D` = 'Incert' THEN 'D(incert)'
WHEN`Reg_Determinari`.`RH_D` = 'D Slab' THEN 'D(Slab)'
WHEN`Reg_Determinari`.`RH_D` = '_______' THEN ''
END AS `Reg_Determinari`.`D`
FROM `Reg_Determinari`
WHERE `Reg_Determinari`.`ID`='%ID%'