I am trying to sort data from different tables by its time..
I have tables:
books:
book_id | book_name | book_time
movies:
movie_id | movie_name | movie_time
And I want to select the latest books and movies together. I would like to sort it like: ORDER BY book_time DESC
But for both tables. I tried it with joins but it wasn’t very good and it was slow too.
I usually try to stay away from subqueries, but if you put the union into one, you can easily order by time: