2021年4月11日星期日

SQL Query Error: sub-select returns 2 columns - expected 1

When I write the following query:

SELECT name  FROM people  WHERE phone_number IN   (SELECT caller, receiver FROM phone_calls WHERE month = 7 AND day = 28 AND year = 2020 AND duration < 60);  

I get the following error: sub-select returns 2 columns - expected 1

Not sure where the issue is... caller is TEXT with phone number.
receiver is TEXT with phone number. My goal is to create a list where instead of showing me to caller and receiver's phone number, it'll show me their names instead.

Also, this is my attempt at CS50's fiftyville.

https://stackoverflow.com/questions/67051500/sql-query-error-sub-select-returns-2-columns-expected-1 April 12, 2021 at 08:56AM

没有评论:

发表评论