F
F
Fezarmon2021-06-27 15:24:14
MySQL
Fezarmon, 2021-06-27 15:24:14

Mysql bug #1241 - Operand must contain 1 columns. How to make an alternative working request?

here is the request

SELECT * FROM `board` WHERE moder=0 AND activ=0 AND id_akk IN (SELECT user_id_to, user_id_from FROM `podpiski` WHERE user_id_from='38')

I understand that in the IN operator, or rather in the SELECT, you cannot select two columns. Could you write an alternative similar query or fix this one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fezarmon, 2021-06-27
@fezarmon

SELECT * 
FROM `board` 
WHERE moder=0 AND activ=0 AND id_akk IN (SELECT user_id_to
                                         FROM `podpiski` 
                                         WHERE user_id_from='38'
                                         union
                                         SELECT user_id_from
                                         FROM `podpiski` 
                                         WHERE user_id_from='38')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question