PostgreSQL
- 1 ответ
- 0 вопросов
1
Вклад в тег
(( SELECT id FROM exchange ), 'ETHBTC'),
(( SELECT id FROM exchange ), 'LTCBTC'),
(( SELECT id FROM exchange ), 'BNBBTC')
INSERT INTO pairs (
exchange_id,
symbol
)
SELECT exchange.id, unnest(ARRAY['ETHBTC', 'ETHBTC', 'BNBBTC'])
FROM exchange
ON CONFLICT ( exchange_id, symbol )
DO UPDATE SET symbol = EXCLUDED.symbol
RETURNING id, exchange_id, symbol