Sample Header Ad - 728x90

Subquery with IN clause

-6 votes
1 answer
47 views
I have a table named “groups” whose projects have been funded as shown enter image description here I have written a query giving the names of all groups that were funded in both 2014 and 2018 using the INTERSECT clause as follows SELECT group.NAME FROM group WHERE group.YEAR = 2014 EXCEPT SELECT group.NAME FROM group WHERE group.YEAR = 2018 I want to write this same query using a sub-request with the IN clause but I am unable to write the condition. This is what I have SELECT group.NAME FROM group WHERE group.YEAR IN (SELECT group.YEAR FROM group WHERE group.YEAR = 2014 AND group.YEAR = 2018)
Asked by Amabo Theophile (1 rep)
Jun 28, 2019, 04:31 PM
Last activity: Jun 28, 2019, 04:52 PM