I have an sql query which uses mod function in the where clause to retrieve the id from a table in oracle database.The below query is written in such a way that ID column values should be divisible by 4 and remainder should be 0.The table is wide and contain million rows.What are other ways to rewrite the query to get result of mod(id,4)=0
with good performance?
Input:
select id from sales where mod(id,4)=0;
Output
id
-------
16248612
265616
21231956
question from:
https://stackoverflow.com/questions/65891953/other-ways-to-write-sql-query 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…