from the above data i want to get the date wise attendance for respective student expecting for this kind of output
can anyone please help what sql query should i use
from the above data i want to get the date wise attendance for respective student expecting for this kind of output
can anyone please help what sql query should i use
You could try using a CROSS APPLY. I have an example below but it is hard to test since I don't have access to the data. Hopefully, this will at least get you in the right direction. try this:
SELECT
ca.name,
ca.attenance_date,
CASE WHEN ca.present = 1 THEN 'Present' AS Present,
CASE WHEN ca.present = 0 THEN 'N/A' AS Not_Present,
FROM Table CROSS APPLY Values (name, attenance_date)) ca
(name, attenance_date);