https://pastein.ru/t/bu
скопируйте уникальную ссылку для отправки
SELECT (SELECT l.main_doctor_fio_short FROM lpu l WHERE main_status=1 AND ROWNUM=1)
,' период с '||TO_CHAR(:DAT1,'dd.mm.yyyy')||' по '||TO_CHAR(:DAT2,'dd.mm.yyyy')
,(SELECT l.text FROM lpu l WHERE main_status=1 AND ROWNUM=1)
,(SELECT d.name FROM solution_apteka.dep d WHERE d.id=:DEP)
,(SELECT l.text
FROM solution_apteka.mol m
JOIN solution_apteka.lu l ON l.id=m.man_luid AND l.status=1 AND m.status=1 AND m.depid=:DEP AND m.code='STS'
)
,(SELECT l.gb_fio_short FROM lpu l WHERE main_status=1 AND ROWNUM=1)
,(SELECT l.stext
FROM solution_apteka.mol m
JOIN solution_apteka.lu l ON l.id=m.man_luid AND l.status=1 AND m.status=1 AND m.depid=:DEP AND m.code='STS'
)
FROM DUAL