0
我有以下查询,它工作正常。Oracle SQL内部连接
SELECT c.id, c.customer_name, b.batch_prefix, b.BatchCount, b.InvoiceCount, e.time_of_delivery, e.time_of_delivery_mail, e.time_of_delivery_clock
FROM koll_customers c
INNER JOIN (
SELECT batch_prefix, COUNT(*) AS BatchCount,
SUM (batch_counter) AS InvoiceCount
FROM koll_batchlogs
WHERE
exists_db = 0
and is_checked = 1
and batch_counter > 0
and trunc(created_date) > trunc(sysdate-7)
GROUP BY batch_prefix) b
ON b.batch_prefix=c.customer_prefix
INNER JOIN koll_customer_export e
ON c.id = e.id
但是,当我添加另一个JOIN(最后一个加入)与SELECT和WHERE提示错误: “无效的标识符”
SELECT c.id, c.customer_name, b.batch_prefix, b.BatchCount, b.InvoiceCount
FROM koll_customers c
INNER JOIN (
SELECT batch_prefix, COUNT(*) AS BatchCount,
SUM (batch_counter) AS InvoiceCount
FROM koll_batchlogs
WHERE
exists_db = 0
and is_checked = 1
and batch_counter > 0
and trunc(created_date) > trunc(sysdate-7)
GROUP BY batch_prefix) b
ON b.batch_prefix=c.customer_prefix
INNER JOIN (
SELECT time_of_delivery
FROM koll_customer_export
WHERE time_of_delivery=2) e
ON e.id = c.id
我不知道,什么是与最后一个问题加入?
完美:-)谢谢。我把它标记为在时间限制结束时解决。 – 2014-12-06 17:55:03