Https://www.codecademy.com/paths/data-science/tracks/sql-basics/modules/dspath-sql-projects-and-applications/projects/user-segmentation-prj

HELLO!!:sweat_smile:
Please could you help me with dealing with Question 5, I am confused as to why my suggestion/code does not make sense or doesn’t bring up any results.

But what is wrong with typing:
SELECT *
FROM users
WHERE campaign = ‘BBB-1’ AND
campaign = ‘BBB-2’
LIMIT 80;

correct ANSWER:
SELECT *
FROM users
WHERE campaign LIKE ‘BBB-%’
LIMIT 80;

If there is a row with the value of BBB-3, this code will return that too where your answer won’t.

BBB-% Will return any value in the campaign column that starts with BBB-

THANK YOU so much for your reply, could you help me as to why my code wouldnt bring up any results at all? (even if BBB-1 and BBB-2 where present in the results )
SELECT *
FROM users
WHERE campaign = ‘BBB-1’ AND
campaign = ‘BBB-2’
LIMIT 80;

I don’t have access to the paths, but it’s probably because you use AND.
In this case the OR keyword should be used because the campaign column can’t be equal to 2 values, only to either of them.

2 Likes