Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
Mysql INNER Join and Search Result With Exact Match

I'm trying to get data from multiple tables with a search keyword.

Here are my tables:

Table -1 translator

id | Name | English | User_id|

1  | کے  | ky       | 0      |

Table-2 boy

id | Name | English | meaning |

1  | علی | Ali  | بلند  |

Table-3 girls

id | Name | English | meaning|

1  | سحرش | Sahrish | جادو |

I want to get the English value with search keyword of 'علی' from both tables. How do I relate 3 tables with 2 columns where the column name is equal? I want to get something like this:

id | Name | English |

1  | علی  | Ali     |

I'm trying this query:

 SELECT translator.Name,translator.English,boy.Name,boy.English,girls.Name,girls.English 
    FROM translator 
    INNER JOIN 
    (boy INNER JOIN girls 
    ON girls.Name = boy.Name) 
    ON translator.Name = boy.Name
    WHERE translator.Name = 'علی' LIMIT 1
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Looking to your result seems you need a UNION (and not a JOIN)

select * from  (
    SELECT Name, English
    FROM translator 
    UNION 
    SELECT Name, English
    FROM boy
    UNION 
    SELECT Name, English
    FROM girls 

    ) t  
    where name  = 'yourvalue' 
   
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda