sql left join 问题,求指导
程序代码:
SELECT DISTINCT TOP (100) PERCENT DATEADD(dd,-1,a.date) as date, a.ItemID_YMC, a.ItemID_YMC2, b.PV FROM ABC AS a LEFT OUTER JOIN EFG AS b ON a.ItemID_YMC = b.ItemID_YMC AND a.date = b.date AND b.PV = --就是这个b.PV这个是什么意思??? (SELECT MAX(PV) AS Expr1 FROM dbo.DS04_YMC_BaiDuLiuLiang AS c WHERE (b.ItemID_YMC = ItemID_YMC) AND (b.date = date))
大神好,我有个问题:
我能看懂是LEFT JOIN
也能看懂ON后面 “a.ItemID_YMC = b.ItemID_YMC AND a.date = b.date”
但是到 “ AND b.PV =
(SELECT MAX(PV) AS Expr1
FROM dbo.DS04_YMC_BaiDuLiuLiang AS c
WHERE (b.ItemID_YMC = ItemID_YMC) AND (b.date = date)) ”
就看不明白了。这里的b.PV 为什么没有 = “一个东西”
例如 a.ItemID_YMC = b.ItemID_YMC 或者 a.date = b.date
求解。。。