我有这个过程,它应该返回基于给定日期和少量其他输入的记录。首先,它在临时表@ branch_ID中放置一个分支,然后从临时表中选取该分支,但它将返回所有分支的记录,而不仅仅是已选取的分支的记录。BranchID INT BEGIN END
BEGIN
INSERT INTO @Branches SELECT Br
Telephone", count(w.id_worker) as "Total subworkers" 3 wherew.id_supervisor and w.id_maintainer=m.id_maintainer and (select count(id_worker) from worker, maintainer where