Remember
Register
Pre Exam Test Practice (
SSC

Banking

IAS

GATE

State Level

CLAT

Railways

Insurance

Teaching Exams

NDA

Defence

IES

State Exam
)
Pre Exam Test Practice
All Activity
Tags
Users
Ask a Question
About Boostr
Advertise on boostr.in
Jobs
Pre Exam Test Practice (
SSC

Banking

IAS

GATE

State Level

CLAT

Railways

Insurance

Teaching Exams

NDA

Defence

IES

State Exam
)
Organizational Research By
Surprising Reserch Topic
sql optimizing between clause
sql optimizing between clause Â using 'sql,oracle,oracle10g'
I wrote a statement that takes almost an hour to run so I am asking help so I can get to do this faster. So here we go:
I am making an inner join of two tables :
I have many time intervals represented by intervals and i want to get Â measure datas from measures only within those intervals.
intervals: has two columns, one is the starting time, the other the ending time of the interval (number of rows = 1295)
measures: has two columns, one with the measure, the other with the time the measure has been Â made (number of rows = one million)
The result I want to get is a table with in the first column the measure, then the time the measure has been done, the begin/end time of the considered interval (it would be repeated for row with a time within the considered range)
Here is my code:
select measures.measure as measure, measures.time as time, intervals.entry_time as entry_time, intervals.exit_time as exit_time
Â Â Â Â from
Â Â Â Â intervals
Â Â Â Â inner join Â
Â Â Â Â measures
Â Â Â Â on Â intervals.entry_time<=measures.time Â and measures.time <=intervals.exit_time Â
Â Â Â Â order by time asc
Thanks
Â Â Â Â
sql
oracle
oracle10g
asked
Sep 16, 2015
by
abhimca2006
Please
log in
or
register
to add a comment.
0
votes
2
views
Related Hot Questions
Government Jobs Opening
...