I have a list of objects with X and Y coordinate columns.
I only want to select objects with Y coordinates greater a value 5804400 when a variable value is greater than 5804400.
Here is my attempt but SQL doesn't like it.
Select * from Panels p
where case when @Val > 5804400 then p.Y > 5804400 else p.Y < 5804400 end