假设我们在关系R(X,Y,Z)中有以下MVD:
X ->> YZ
因为我可以在SQL中编写FD X -> Y
:
SELECT X
FROM R
GROUP BY A
HAVING COUNT (DISTINCT Y) > 1
我尝试将相同的逻辑思想应用于上面提到的MVD:
SELECT X
FROM R AS R1
INNER JOIN
R as R2
ON R1.X = R2.X
GROUP BY R1.X, R2.X
HAVING COUNT(DISTINCT R1.B > 1) and COUNT(DISTINCT R1.C > 1)
但有些内容对我来说并不合适,特别是JOIN
和HAVING
语句。有人可以告诉我这里有什么问题吗?