I have 3 tables from which I would like to get some data:
Main table:
create table if not exists exchange
(
id bigint,
name varchar(255),
);
INSERT INTO exchange (id, name)
VALUES (1, 'PARIS');
Second table:
create table exchange_api
(
id bigint,
api_name varchar(255),
exchange_id bigint
);
INSERT INTO exchange_api (id, api_name, exchange_id)
VALUES (8, 'PARIS-API', 5);
Third table:
create table instrument
(
id bigint,
symbol varchar(255),
exchange_api_id bigint
);
INSERT INTO instrument (id, symbol, exchange_api_id)
VALUES (47, 'PARIS-ARD', 8);
INSERT INTO instrument (id, symbol, exchange_api_id)
VALUES (48, 'PARIS-SRD', 8);
I need to map the the tables following way:
First table exchange I want to send param PARIS
and as a result I want to get this result:
PARIS-ARD
PARIS-SRD
How I can get this data using JOIN?