select s.name,s.class_code,s.grade_code,t.name as head_teacher_name
from students s
join teachers t on s.class_code =t.head_teacher
order by s.student_id
select s.name,s.class_code,t.name as head_teacher_name,
s.grade_code from students s
join teachers t on s.class_code =t.head_teacher
order by s.student_id
select * from cmb_usr_trx_rcd
where usr_id=5201314520
and (date(trx_time) between '2024-9-1' and '2024-9-30'
and hour(trx_time) between 22 and 24
or hour(trx_time) between 0 and 5)
order by trx_time;
select * from cmb_usr_trx_rcd
where usr_id=5201314520
and date(trx_time) between '2024-9-1' and '2024-9-30'
and hour(trx_time) between 22 and 24
or hour(trx_time) between 0 and 5
order by trx_time;
select
*
from
cmb_usr_trx_rcd
where
date(trx_time)
between '2024-09-01' and '2024-09-30'
and (
(hour(trx_time) >= 22)
or
(hour(trx_time) between 0 and 5)
)
and usr_id = '5201314520'
order by trx_time