Click to See Complete Forum and Search --> : Please help for SQL Queries!


casperinlove
05-18-2004, 12:23 PM
I have a problem need help,

a table contain date, topics, name.... etc.

what i need to do is
i) check who had join the same course more than once within 60 days
ii) check who had join more than once course within 14 days.

this mean that no more than once course allow withn 14 days and no duplicate courses allow within 60 days.

the datas in the table something like this...

DATE TOPICS NAME
14-JAN-2004 Mathematics Peter Anderson
14-JAN-2004 Mathematics Mary Thomson
-
-
-
-
-
20-FEB-2004 Physics Peter Anderson
20-FEB-2004 Physics Mary Thomson
-
-
-
-
-

Can anyone help for the SQL Queries to get the answers of it?

Thanks a lot.

ph34r
05-18-2004, 12:35 PM
You are gonna need to do some sub-queries, etc. to get it all in one select statement.... or do some temporary storage (in an array maybe). It will all depend on what SQL server you are using, and what language you are programming in. I'd get the O'Rieley (sp?) pocket reference guide for SQL.

casperinlove
05-18-2004, 12:56 PM
Cause I am a newbie on SQL, Can you do me a favour to write that codes for me Please?

or any other web sites I can find something like that SQL information?

Thanks.

jim mcnamara
05-18-2004, 01:31 PM
We need to know - Oracle? MySql? Access? what database?

Not all SQL is the same, especially date functions.

casperinlove
05-19-2004, 01:39 AM
What about I uses Microsoft Access as Database?

Thank you.