Skip to content
Advertisement

Error => #1242 – Subquery returns more than 1 row

I am selecting order data from my orders table with that I also need the order product’s count which contains a specific word

Account TopUp 200,
Account TopUp 500,
Account TopUp 1000,

The order contain multiple product means one order contains both(Account TopUp 200, Account TopUp 500) and other products

I made a subquery for this

But it gives Error: #1242 – Subquery returns more than 1 row

The full query is :

Advertisement

Answer

The subquery you highlighted in your question actually doesn’t have any problem with it and won’t cause the error message you are seeing. But this subquery will:

This subquery will most likely return multiple records/values, and therefore makes no sense appearing in the SELECT clause. Fix this problem and your query should work.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement