In my case, I have 2 Project and Activity tables, and they look like this.
A project is a table at the top and activity at the bottom.
In the Activity table, activityID and projectID are Primary Keys.
What I'm trying to achieve is to create a view that returns all projects that have actions that have endDate later than ProjectededEndDate.
In conclusion, I want to do this:
SELECT *
FROM Project
WHERE (SELECT MAX(endDate) FROM Activity GROUP BY projectID) > projectedEndDate
But I get the following error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
thanks
source
share