我试图在三个不同的数据库中的三个表上运行查询。这个查询的工作原理,但我拉近十亿条记录...是否有任何解决方案从以下查询中抽取smlog.requestor_type和arcust.maj_class的不同字段?跨三个数据库的SQL三联左连接查询
SELECT
smreq.request_id AS ROIrequestID,
arcust.customer AS LAWcustID,
smlog.logid AS ESLlogID,
arcust.maj_class AS invoicetype,
smlog.requestor_type AS SMLrequestortype,
smlog.request_type as SMLrequesttype
FROM roi.sm_request_sp_data reqsp
LEFT JOIN [email protected] smlog ON smlog.logid = reqsp.logid
LEFT JOIN roi.sm_requests smreq ON smreq.request_id = reqsp.request_id
LEFT JOIN [email protected] arcust ON arcust.customer =
smreq.customer_id
WHERE smreq.ORIG_DT >= TO_DATE('2016/03/01', 'yyyy/mm/dd')
AND smreq.ORIG_DT <= TO_DATE('2016/03/02','yyyy/mm/dd')
GROUP BY smlog.requestor_type;
向我们展示db架构,示例数据,当前和预期输出。 \t请阅读[**如何提问**](http://stackoverflow.com/help/how-to-ask) \t \t这里是一个伟大的地方[** START **] (http://spaghettidba.com/2015/04/24/how-to-post-at-sql-question-on-a-public-forum/)来了解如何提高您的问题质量并获得更好的答案。 \t [**如何创建一个最小的,完整的,并且可验证例如**](http://stackoverflow.com/help/mcve) \t尝试创建一个样品中http://rextester.com –
是你的问题现在解决了?你仍然有关于这个答案的问题吗?要接受答案“[**点击Tick **](https://ibb.co/ikqyO6)”以获取更多信息,请参阅[help/accepting](https://stackoverflow.com/help/someone-answers)* *每次接受都会获得2个声望点** –