Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

oracle - other ways to write sql query

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...