1
Привет, это запрос, чтобы получить количество разных данных из разных таблиц.Как построить вложенный запрос в codeigniter?
select(
select count(*)
from teachers
where teacher_status = 1
)as teacher_count,
(
select count(*)
from students
where student_status = 1
)as students_count,
(
select count(*)
from housekeepers
where housekeeper_status = 1
)as housekeeping_count,
(
select count(*)
from students
where student_status = 1 and
gender = "Male"
) as total_male_student_count,
(
select count(*)
from students
where student_status = 1 and
gender = "Female"
) as total_female_student_count
Теперь я хочу, чтобы построить этот единственный запрос в CodeIgniter с помощью класса CodeIgniter строителя, так что может кто-то наставит меня пожалуйста ..
Цель работы одного запроса, чтобы минимизировать попадание базы данных.
Заранее спасибо .. !!!