[英]Can I make a temp table with other temp tables
I'm wondering if I can pull together the data from my other temp tables. 我想知道是否可以将其他临时表中的数据汇总在一起。
I need to be able to run a report for many different people from different departments and then aggregate the data so that I have individual reports, a larger picture of each department, and the entire floor including all departments to get the big picture. 我需要能够为来自不同部门的许多不同人员运行报告,然后汇总数据,以便获得单个报告,每个部门的整体情况以及包括所有部门在内的整个楼层的整体情况。 I have all the associates id #'s but I will need to separate each associate and department with their different "roles" in the company and most all have multiple roles assigned to them in the database. 我拥有所有的员工编号,但是我需要将每个员工和部门与公司中不同的“角色”分开,并且大多数人在数据库中都分配有多个角色。
So to avoid running a report for each associate, department, security role, function role, and the different task matrix that is important for them (# of calls, emails, task a, b, c, and pass through process az) which all depends on the person, etc., I created temp tables for some of the most important for all and will tie in the rest. 因此,要避免为每个员工,部门,安全角色,职能角色以及对他们来说很重要的不同任务矩阵(呼叫,电子邮件,任务a,b,c和通过流程az)运行报告,取决于人等,我为所有人中最重要的一些人创建了临时表,并将它们结合在一起。 To avoid having to change the date range of the report every time I pull it, I was hoping to aggregate the temp tables and change the date just the once in the aggregated temp table. 为避免每次我拉报告时都必须更改报告的日期范围,我希望汇总临时表,并仅在汇总临时表中更改一次日期。 Then I can run the query with the rules I need. 然后,我可以使用所需的规则运行查询。
Example: 例:
`tmp.notes`; (requestid, userid, createDT)
`tmp.custcont`; (customer contact), (requestid, userid, createDT)
`tmp.emails`; (requestid, userid, createDT)
`tmp.calls`; (requestid, agent_id(= to users username, createDT)
`tmp.users`; (id, personid, username)
Once you've created a temporary table, you can use it as you would any other table. 创建临时表后,就可以像使用其他任何表一样使用它。 Therefore, you can almost certainly do what you want. 因此,您几乎可以确定要做什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.