7
I’m having a problem I haven’t found a solution to so far. I have 3 tables in Mysql:
- Units:containing information from "stores".
- Orders: contain the order information made by loja01 for loja02, both registered in the units table.
- Users: and finally users with information of who made the request.
The problem is when I try to recover the source and destination information that are both in the drives table.
SELECT
ped.cod_pedido,
ped.origem,
ped.destino,
ped.obs,
ped.usuario,
und.nome_unidade
FROM pedidos as ped
INNER JOIN usuarios as usr ON (ped.usuario = usr.cod_user)
INNER JOIN unidades as und ON (ped.origem = und.cod_unidades)
But by doing so I cannot recover the information I need only returns these results:
I’d like to make the names of the units appear instead of your code.
Could someone help me?