I searched for a while, but the query I'm trying to fulfill is pretty hard to find any information or documentation on how to do what I'm trying to do.
I have two tables, one of which stores my user accounts and basic information. Then I have a second table that contains a bit more information about the user.
Both of these tables have primary keys (the first table idand the second table user_id), which I use to know who is who and to match records between the two tables.
What I'm trying to do today is get 10 entries from table 1, sort by column in table 2 (room_count) DESC.
The name of table No. 1 is "users", and the name of table No. 2 is "user_information".
What have i tried?
I'm not quite sure where to start, so I haven't tried anything yet.
How could I do something like this? Thanks for any posted answers.
For example, let's say I have 4 users, I will write the username followed by the room_count column in the following table below.
Adam Sandler : 4
Jenny Hang : 9
Peter Foreign : 0
If I used a query with ASC, it starts with Peter Foreignand ends withJenny Hang
source
share