A candy bar to anyone that can help me with this one, because I have no idea how to accomplish this. The code so far:
This will give me output (minus the count and stuff I've already accomplished) looking like:
What I want to limit this query further to show the 4th and 5th lines only. Reason: I want to identify only those rows that have one ProjectID for multiple ProjectKeys. I have no idea how.
Any help would be greatly appreciated. Thanks.
Code:
SELECT Count(L.ProjectID) AS [Count], L.ProjectID, L.ProductID, L.ProductDescription, L.MNEMONIC, C.ProjectKey, C.Product
FROM [L. Data] AS L LEFT JOIN [C.] AS C ON L.ProjectID = C.ProjectID
WHERE (((C.Project_Type)<>"Site Rollout") AND ((C.Version)="millennium"))
GROUP BY L.ProjectID, L.ProductID, L.ProductDescription, L.MNEMONIC, C.ProjectKey, C.Product
ORDER BY L.ProductID, L.MNEMONIC, C.ProjectKey;
This will give me output (minus the count and stuff I've already accomplished) looking like:
Code:
+-----------+-----------+-------------+------------+---------+
| ProjectID | ProductID | ProductDesc | ProjectKey | Product |
+-----------+-----------+-------------+------------+---------+
| 1001 | AA | Aaaaaaaa | 101 | Aaaa |
+-----------+-----------+-------------+------------+---------+
| 1002 | BB | Bbbbbbbb | 102 | Bbbb |
+-----------+-----------+-------------+------------+---------+
| 1002 | CC | Cccccccc | 102 | Bbbbb |
+-----------+-----------+-------------+------------+---------+
| 1003 | DD | Dddddddd | 103 | Ccccc |
+-----------+-----------+-------------+------------+---------+
| 1003 | EE | Eeeeeeee | 104 | Ddddd |
+-----------+-----------+-------------+------------+---------+
What I want to limit this query further to show the 4th and 5th lines only. Reason: I want to identify only those rows that have one ProjectID for multiple ProjectKeys. I have no idea how.
Any help would be greatly appreciated. Thanks.