W
W
Webber2021-04-27 11:50:08
PostgreSQL
Webber, 2021-04-27 11:50:08

What is the best way to make a request for a selection?

There is such a database schema .

One purchase can be for several devices.

What is the best way to make a request for a selection of purchases by device (uuid + application_id). Or with 2 johns of norms?

select purchases.* from purchases
join device_purchase dp on purchases.id = dp.purchase_id
join devices d on dp.device_id = d.id
where d.application_id = 114 and d.uuid = 'aaac606a-6182-de08-bace-53c939d00008';

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question