Scheduking query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    #1

    Scheduking query

    Table t2, below, records the Date on which an Actor performs a Role.
    Rules:
    1. perform 1 role per date
    2. perform each role before starting again

    B is the next Actor in line to perform Role=1 on Date=2003-10-20

    Is there a query that will select B and exclude A & C since they have
    already performed role 1.

    The data is simplified - there are approximately 20 roles and 60 actors

    Any help would be greatly appreciated
    Dave

    roleID,DATES,ac torID
    1,2003-10-06,A
    2,2003-10-06,B
    3,2003-10-06,C
    1,2003-10-13,C
    2,2003-10-13,A
    3,2003-10-13,B


  • BDR

    #2
    Re: Scheduking query

    You need a program, not just a query...

    Or if you could supply a sample `desired` output format it would be
    easier than deciphering a bonus question on an sql quiz :-)

    ie; You've supplied the source table, now tell us what it should look
    like on output. (you should also try searching for the word `wizard` on
    mysql.com - seriously)


    Dave wrote:[color=blue]
    > Table t2, below, records the Date on which an Actor performs a Role.
    > Rules:
    > 1. perform 1 role per date
    > 2. perform each role before starting again
    >
    > B is the next Actor in line to perform Role=1 on Date=2003-10-20
    >
    > Is there a query that will select B and exclude A & C since they have
    > already performed role 1.
    >
    > The data is simplified - there are approximately 20 roles and 60 actors
    >
    > Any help would be greatly appreciated
    > Dave
    >
    > roleID,DATES,ac torID
    > 1,2003-10-06,A
    > 2,2003-10-06,B
    > 3,2003-10-06,C
    > 1,2003-10-13,C
    > 2,2003-10-13,A
    > 3,2003-10-13,B
    >
    >[/color]

    Comment

    Working...