For example i have 50 million+ rows in a table with columns Customer_ID, Order_ID and trans_date. I need a query to return customers with more than 2 orders over the past 60 days.
Select customer_id from table where trans_date between sysdate-60 and sysdate group by customer_id having count(customer_id)>=2
I am trying to understand if there is fastest alternative for group by and having. Especially for large data sets. Thanks in advance for your help/suggestions.
svk