2

I have a situation where if the column value is less the 1 then I have to show NO as column value, else YES. I am using CASE statement for this. But after applying CASE statement query is taking to much time to execute. Is there any alternate way of achieving this without using CASEstatement?

piet.t
  • 11,718
  • 21
  • 43
  • 52
gkarya42
  • 429
  • 6
  • 22

1 Answers1

2

It's difficult to say without seeing the initial code. But with a simple Yes/No it might be worth looking into two selects with a union all:

(1) First select where value < 1

union all

(2) Second select where value >= 1

Ralph
  • 9,284
  • 4
  • 32
  • 42