|
Dcalladi
Starting Member
2 Posts |
Posted - 02/24/2012 : 10:17:48
|
I have two tables Test_items and Stock_levels i want to get the name from the Test_items and the current stock , min sotck and max stock from Stock_levels and the condition is that current stock need to be smaller than 1
i tried
SELECT Test_items.Name, Stock_levels.Current_Stock, Stock_levels.Min_Stock, Stock_levels.Max_Stock FROM Test_items , Stock_levels WHERE Stock_levels.Item_Id = (SELECT Item_id FROM Stock_levels WHERE Current_Stock < 1) AND Stock_levels.Item_Id = Test_items.Id
this gives me #1242 - Subquery returns more than 1 row
ovbiously becuase of the nested query. i am just wondring if there is a way to do it without a nested solution so it works or if there is just another way of doing it. |
|