Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAmitai Blickstein
6,863 PointsI checked my answer by hand, it is correct! What did I do wrong?
There are 11 female customers, 2,3,7,9,11,14,16,21,23,24,26, which is precisely what my code returns.
This is my code:
SELECT *
FROM Sale AS s
INNER JOIN (
SELECT *
FROM customer
WHERE gender = 'F'
) as fem
ON s.customerID = fem.customerID
ORDER BY customerID;
1 Answer
Steven Parker
231,236 PointsYour sub-query doesn't need to select all columns, it only needs to select the CustomerID.
That way, only the columns from the Sale table will be shown (as the instructions asked) instead off all columns from both tables.