Learn sql multiple tables 7 / 10 - cross join


#1

Can anyone please post the solution to this “cross join” section?


#2

Rather than posting the solution, if you post your attempt at solving it you might find that someone will help you understand where your solution is wrong and fix it. :slight_smile:


#3

SELECT month
COUNT (*) AS subscribers
FROM newspaper
CROSS JOIN online
WHERE start_month = month
AND end_month = month
GROUP BY subscribers;

wjondering where I went wrong


#4

Hi, sorry for the delay in replying to you. :slight_smile:

Taking a quick look at your SQL, it looks like you’re asking for two columns of data to be returned from your query: month, and COUNT(*) AS subscribers.

If we re-write your SELECT as a single line:

SELECT month COUNT(*) AS subscribers

can you see what is missing? :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.