How to get the result of two sqlite tables

Asked

Viewed 64 times

1

inserir a descrição da imagem aqui

What I want to get is Currencies that belong to a particular country Name. Parents, code.Currencies, name.Currencies, Symbol. Currencies

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

*'AL' being a value of a variable

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';

Browser other questions tagged

You are not signed in. Login or sign up in order to post.