0
Well I have the following tables:
Requests
id id_cliente id_vendador
1 10 20
2 10 30
3 10 20
Devotions
Id data id_pedido
1 2017/01/01 3
I need to make a ? select' informing the ? id' of the order table, and it has to return the returns that contain the same order customers.
Example:
and id IN(1,2)
He has to return the return ID 1 to me, because her 'id_request' is 3 and the 'id_client' is the same as the order.
Can anyone help me? I’ve broken my head here.
is giving this error here '#1241 - Operand should contain 1 column(s)'
– Hugo Borges
@Hugoborges You have replaced what is between brackets with the id you want to put?
– Sorack
yes of course neh, put 'Ped.id = (1,2)'
– Hugo Borges
@Hugoborges there is your mistake, the operator
=
accepts only one argument, to use the(1, 2)
you must use the operatorIN
, as you yourself had said in your question:ped.id IN (1, 2)
– Sorack
off and even, my mistake. It worked, thank you very much
– Hugo Borges