I have a problem a few days ago. I have a select that does some inners and should return 3 lines, but one of the inners has several results linked to the result searched; how to limit to this inner get only the first result and select continue to return the 3 lines?
SELECT 'imovel'.'imvValorImovel', 'imovel'.'imvCodigo',
'imovel'.'broCodigo', 'imovel'.'imvDormitorio', 'imovel'.'imvSuite',
'imovel'.'tpoCodigo', 'imovel'.'imvGaragem', 'bairro'.'broNome',
'tipo'.'tpoNome', 'imagem_imovel'.'imaNome'
FROM 'imovel'
INNER JOIN 'bairro' ON 'imovel'.'broCodigo' = 'bairro'.'broCodigo'
INNER JOIN 'tipo' ON 'imovel'.'tpoCodigo' = 'tipo'.'tpoCodigo'
INNER JOIN 'bairro' ON 'imovel'.'broCodigo' = 'bairro'.'broCodigo'
INNER JOIN 'imagem_imovel' ON 'imovel'.'imvCodigo' = 'imagem_imovel'.'imvCodigo
WHERE 'imovel'.'broCodigo' = "'.$resultado->broCodigo.'"
AND 'imovel'.'tpoCodigo' = "'.$resultado->tpoCodigo.'"
AND 'imovel'.'imvFinalidade' = "'.$resultado->imvFinalidade.'"
LIMIT 3