MySQL Forums
Forum List  »  Optimizer & Parser

Query Statement
Posted by: BattleMan BattleClan
Date: March 30, 2006 01:43PM

the query for a certain date range

SELECT * FROM BudgetActivities WHERE ActivityGroupID IN ( SELECT ActivityGroupID FROM BudgetActivities WHERE ActivityID = 0 AND PeriodStart < _PeriodEnd AND PeriodEnd > _PeriodStart ) ORDER BY ActivityGroupID,ActivityID;

and in readable form
SELECT * FROM BudgetActivities WHERE
ActivityGroupID IN (
SELECT ActivityGroupID FROM BudgetActivities WHERE
ActivityID = 0
AND
PeriodStart < _PeriodEnd
AND
PeriodEnd > _PeriodStart
) ORDER BY ActivityGroupID,ActivityID;

Options: ReplyQuote


Subject
Views
Written By
Posted
3162
March 30, 2006 07:44AM
2007
March 30, 2006 09:02AM
Query Statement
2606
March 30, 2006 01:43PM
2126
March 30, 2006 04:03PM
1983
March 31, 2006 04:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.