Hi Everyone
This is a little difficult to explain so please bear with me. I’ll use a simplified example to make it easier. I have a table called BOOKS and a table called ORDERS.
BOOKS has the fields BOOK_ID, NAME and AUTHOR.
ORDERS has the fields ORDERNO, DATE, CUSTOMER_NAME and BOOK_ID
The books are books that could be ordered and they therefore have a one to many relationship with ORDERS as one book can be ordered many times. This relationship is based on the column BOOK_ID.
I want to run a SQL query on this data that will show me the BOOKS that have been ordered 3 or more times in any 30 days. That’s ANY 30 days, so averages are no good and neither are specific periods.
Is this possible?
Cheers
Spangeman
This is a little difficult to explain so please bear with me. I’ll use a simplified example to make it easier. I have a table called BOOKS and a table called ORDERS.
BOOKS has the fields BOOK_ID, NAME and AUTHOR.
ORDERS has the fields ORDERNO, DATE, CUSTOMER_NAME and BOOK_ID
The books are books that could be ordered and they therefore have a one to many relationship with ORDERS as one book can be ordered many times. This relationship is based on the column BOOK_ID.
I want to run a SQL query on this data that will show me the BOOKS that have been ordered 3 or more times in any 30 days. That’s ANY 30 days, so averages are no good and neither are specific periods.
Is this possible?
Cheers
Spangeman