query help

  • hi friends i am new to sql i have a table with fields

    Table=ATTENDANCE

    Attenid studentid teacherid repleceteacherid currentdat classid

    1 1 1 0 6/7/2012 1

    2 2 0 2 7/7/2012 1

    3 1 1 0 8/7/2012 1

    now i want to calculate teacher attendance between 2 dates each teacher is assigned to one class when teacher takes his class then his teacherid is get inserted to teacherid col(with replacement=0)

    and when other techer takes the class then his teacherid get inserted in replacementteacher col(with teacherid=0)

    i want the output in the following form

    totallectures presentlectures absentlectures

    10 7 3

    how to write query if possible send me the query

    please help

  • Is this a homework assignment?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply