'no rows selected message when trying to run a sql command [closed]

select first_name, last_name, accountID, balance
from customer c,  account a
where c.customer_ID = a.accountID;

with this this command i get a message which states "no rows selected" someone please give guidance



Solution 1:[1]

There are either:

  1. No rows in the customer table;
  2. No rows in the account table; or
  3. No rows where the customer_ID column of the customer table is equal to the accountID column of the account table.

You should check whether there are rows in the tables and whether it is appropriate to join the two tables on those two columns? Is it valid that you are checking if the identifier for an account matches the identifier for a customer?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MT0