17 lines
1.2 KiB
Plaintext
17 lines
1.2 KiB
Plaintext
select distinct p.people_type,hloi.ordered_by_num,p.first_name,p.last_name,p.label_note,p.class_num AS class_num,p.user_num,c.division,c.sequence,c.grade,hloi.order_num,p.class_num AS clnum, p.meal_location AS mlnum,hloh.added_date,hloh.paid_date,hloh.status,delivered
|
|
from hotlunch_order_header as hloh, hotlunch_order_items as hloi, hotlunch_menu_items as hlmi, people as p
|
|
left join classes as c on c.school_num = 20200 and p.class_num = c.record_num
|
|
left join people as p1 on c.teacher1 = p1.record_num
|
|
where hloh.record_num = hloi.order_num
|
|
and hloh.status not in ('Inactive','Deleted')
|
|
and hloi.ordered_by_num = p.record_num
|
|
and hloh.ordered_by_num = p.record_num
|
|
and hloi.school_num = 20200
|
|
and hlmi.school_num = 20200
|
|
and p.school_num = 20200
|
|
and p.status != 'Inactive'
|
|
and hloi.menu_item_num in (15339579,15339580,15339581,15339582,15339583,15339584,15339585,15339586,15339587,15339588,15339589,15339590,15339591,15339592,15339593,15339594,15339595,15339596,15339597,15339598,15339599,15339600,15339601,15339602,15339603,15339604,15339605,15339606,15339607,15339608,15339609,15339610,15339611,15339612,15339613,15339614)
|
|
and hloi.menu_item_num = hlmi.record_num
|
|
and hloi.active != 'N'
|
|
order by sequence,people_type desc,last_name,first_name
|