A_rmas
A_rmas

Reputation: 784

room query to return object from 1 table with filters from another table

I got main object in table-A. table-B consists of some ids of objects in table-A of and time in millis. I want to get those objects from table-A whose id is in table-B sorted by time in millis in table-B. I got the unsorted objects with this query:

Select * from $table-A where id in (Select id from $table-B)

I am stuck on sorting them by the time in table-B

Upvotes: 0

Views: 72

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269953

You would use join:

Select *
from a join
     b
     on a.id = b.id
order by b.time_in_milliseconds

Upvotes: 2

Related Questions