SELECT EMP_NO, EMP_NAME, SUM(DECODE(STATUS, 'PRESENT'
, 1, 0)) TOTAL_PRESENT,
SUM(DECODE(STATUS, 'ABSENT', 1, 0)) TOTAL_ABSENT,
SUM(DECODE(STATUS,'SICK LEAVE', 1, 0)) TOTAL_SICK_LEAVE,
FROM EMP_TABLE
GROUP BY EMP_NO, EMP_NAME
-----Original Message-----
From:
Thorsten Hilker [mailto:t_hilker@xxxxxxxxx]
Sent: Monday, February
03, 2003 1:23 PM
To: enhydra@xxxxxxxxxxx
Subject: RE:
Enhydra: Supporting help ....
I am facing some problem. Please help me ! I
have a attendance table, Every day i entry employee present and absent time
and one status column to maintain employee's present or absent status.
I entry one month data at that table and I wish
to write a query , that can show individual employee record with in one
row..as like this example table ....
My Actual Table
EmpNo
Name
Status Date
----------- --------- ---------- ---------
1000 Mr.
Joy Sick
Leave 01-Jan-03
1000 Mr.
Joy Present
02-Jan-03
1000 Mr.
Joy Absent
03-Jan-03
1000 Mr.
Joy Present
04-Jan-03
My SQL query should be display
....
EmpNo
Name
Present Absent
Sick
Leave
----------- --------- ---------- ----------- --------------
1000 Mr.
Joy
2 1 1
Please, Help me " How can i write this type of
SQL Query "
Thanks and Beast Regards ...
G.K.M. Shafiul Alam Bhuiyan
(Computer
Programmer)
_______________________________________________
Enhydra mailing list Enhydra@xxxxxxxxxxx
http://www.enhydra.org/mailman/listinfo.cgi/enhydra