Connecting Tech Pros Worldwide Forums | Help | Site Map

Optimize query(2)

Newbie
 
Join Date: Jun 2009
Posts: 2
#1: Jun 30 '09
Hello,
Several IDs noted by several sources. I would select all the IDs that are observed by all three sources. This applies only to data from the past 24 hours.

So far I have:

Select *
From db
Where id in ( Select id
From db
Where source = source_1)
And id in ( Select id
From db
Where source = source_2)
And id in ( Select id
From db
Where source = source_3)
And insertdate > (sysdate-1)

This query requires a lot of power. Can you think of a query that reported better performance than this?
Thanks!

Member
 
Join Date: Dec 2007
Posts: 47
#2: Jun 30 '09

re: Optimize query(2)


It may be better if you show us the format of your table(s). The information you have and what info you want out the table.
Reply

Tags
optimize, oracle, sql