select iq.*, (iq.TotalUsers-iq.present) as absence ( select a.Department, count(id) as TotalUsers (select count(user_id) from attendance, users where users.id=user_id and users.department=a.department group by department) as present, from users a group by a.Department) iq
You can use db::select(db::table($query)) where query is your query string. It returns a query builder Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community