Well I have the following tables:
Orders
id id_cliente id_vendador
1 10 20
2 10 30
3 10 20
Devolutions
Id data id_pedido
1 2017/01/01 3
I need to do a 'select' by entering the 'id' of the requests table, and it has to return me the returns that contain the same clients as the requests.
Example:
and id IN(1,2)
It has to return the ID 1 of the return because the 'order_id' of it is 3 and the 'customer_id' is the same as the request.
Can anyone help me? I've already broken my head here.