Q:

Is there a way to use conditions in case-when statement?

My query(won't run):
SELECT * FROM TABLE A
WHERE (case when mode = 1 then Tonnage > 1000
          when mode = 2 then Tonnage > 5000
          else Tonnage < -1
)

What I am trying to do is to choose different filter critieria (tonnage) based on the other column (Mode). 
However, this won't work due to the >.
Is there a way to fix it?

A:

You don't need a case:
where (mode = 1 and Tonnage > 1000) or
      (mode = 2 and Tonnage > 5000) or
      ( (mode not in (1, 2) or mode is null) and Tonnage < -1)

