People do not know if this is normal in sql but I'll post here to get my doubts. I have a query with three tables using INNER JOIN, apparently the result is favorable, but a small detail bothers me. see example. What happens is the following in the source_code column where there is no values in the column_codes_column and column_codes_list, it should return null and not 3 and 1. I do not know if this is a normal behavior error. For where is 1 in the code_code column I know the rest does not exist. I'm sorry I'm very new to mysql.
SELECT b.cod_produto, b.nome_produto, a.cod_loja, a.cod_lista, c.codigo_loja, c.preco_produto, b.preco_produto
FROM lista_de_compras AS a
lEFT JOIN itens_lista_compras AS b ON a.cod_lista = b.cod_lista
LEFT JOIN loja_produto AS c ON b.cod_produto = c.codigo_produto
WHERE a.cod_lista =1