9
Answers

query help

sameer gadade

sameer gadade

12y
3.4k
1
hi friends i am new to sql i have a table with fields
        Table=ATTENDANCE

Attenidstudentid teacherid repleceteacherid currentdatclassid
11  1           0         6/7/2012 1
22  0           2         7/7/2012 1
31  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 

[:(]
Answers (9)