Question: Right at this moment do I have in one table orders on which I need to delete data from. In the table from where I need to remove rows from are there 2 connections. One of the connections refers to a table with the name/sub name of the customer.
I need to delete from these customers with a specific sub name in the orders table a certain number of product. To get the list of products I need to remove do I need to check into the third table at the price of it.

Below is the following query I have created but returned me an error on which I'm not really surprised.

```
    DELETE FROM `table1`
WHERE `entry` = (SELECT `entry` FROM `table2` WHERE `subname` = 'Buyer')
    AND `item` = (SELECT `entry` FROM `table3` WHERE `Price` != '226' OR '232');

```

Running this query got me to the following error..

> 
> Error Code: 1242 Subquery returns more than 1 row
> 
> 
> Execution Time : 0 sec Transfer Time : 0 sec Total Time : 0.044
>  sec
> 
> 
> 

Can anybody help me with the proper query setup?

Answer: 
You need to use IN clause instead of equality

If you were to remove customer records from table based just on customer name, your query would be like 

```
DELETE FROM `table1` 
WHERE `entry` IN (SELECT `entry` FROM `table2` WHERE `subname` = 'Buyer') 

```
Your query should be

```
DELETE FROM `table1`
WHERE `entry` IN (SELECT `entry` FROM `table2` WHERE `subname` = 'Buyer')
    AND `item` IN (SELECT `entry` FROM `table3` WHERE `Price` != '226' OR '232');

```