Skip to content
Advertisement

How to short a sql case query that uses between

Hi have this sql query:

How can I short this query so I don’t use a lot of case statements?

Advertisement

Answer

You can try using mod subtracting the remainder t from you value by division for 1000

or as suggested by @DM you can also use

the difference should be the same .. both involve function .. but there are nit where condition so this is not in contrast with indexing

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement