Using case statement in Where section (with column)
I want to use a case statement in a where clause. But changing the where position depends on my equation.
For example:
Table
ID Column1 Column2 1 2 3 2 4 1 3 5 4 4 4 7
Query
select * from table
where (case when column1>=column2 then column2>3 else column1>3 end)
Expected Result
ID Column1 Column2 3 5 4 4 4 7
+3
source to share
5 answers