SELECT CASE WHEN 1=1 THEN 1 ELSE 0 END AS
Comparsion_Result ---It'll Work
SELECT CASE WHEN 1=1 THEN '1' ELSE '0' END AS
Comparsion_Result---It'll Work
SELECT CASE WHEN 'A'='B' THEN 'A' ELSE 'B' END AS
Comparsion_Result---It'll Work
SELECT CASE WHEN 'A'='B' THEN 1 ELSE 0 END AS
Comparsion_Result---It'll Work
/*Not Working*/
SELECT CASE WHEN 1=1 THEN 'A' ELSE 0 END AS Comparsion_Result---n't
working
SELECT CASE WHEN 1=2 THEN 1 ELSE 'B' END AS Comparsion_Result---n't
working
/*Below are the Same comparison as
above these are working now*/
SELECT CASE WHEN 1=1 THEN 'A' ELSE 'B' END AS
Comparsion_Result---It'll Work
SELECT CASE WHEN 1=2 THEN 'A' ELSE 'B' END AS
Comparsion_Result---It'll Work
Reason: The output result is not converting into Int see the below error:
No comments:
Post a Comment