How to get the result of two tables in sqlite

1

What I want to get is the Currencies that belong to a particular country ' name.Pais, code.Currencies, name.Currencies, symbol.Currencies

SELECT * FROM moedapais where alpha2Codes = 'AL';
SELECT * FROM Currencies where code =code.moedapais;

* 'AL' being a variable value

    
asked by anonymous 09.12.2017 / 15:45

1 answer

2

What you need is an INNER JOIN.

SELECT Currencies.code, Currencies.name, Currencies.symbol 
FROM moedapais  
INNER JOIN Currencies ON (Currencies.code = moedapais.code)
INNER JOIN Pais ON (Pais.alpha2Code = moedapais.alpha2Codes)
WHERE alpha2Codes = 'AL';
    
09.12.2017 / 15:58