Skip to content
Advertisement

MySQL said: Documentation- Subquery returns more than 1 row

The following renders the correct output.

But, when I change bb.question_id = 82 to any other question_id (i.e. 56 is another question) I get this error:

” MySQL said: Documentation #1242 – Subquery returns more than 1 row”

Any idea what I’m doing wrong?

Advertisement

Answer

It simply means that there are multiple records available for bb.question_id = 82 and you must have used it in the SELECT clause or with = operator in the WHERE clause where a single value is expected.

  • You can either use the aggregate function on answer_data
  • Or You can use the LIMIT 1 to fetch only one record out of multiple records

Use this:

Tip of the day: Always use the standard ANSI joins.

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