I have a 2 MySQL tables like that:
Table: WIFI_Spots
*********************
ID | Name
1 | Foo
2 | Bar
Table: WIFI_Users
*********************
Spot_ID | User_ID | Status
1 | 3h8n26j | active
1 | h6m78v2 | inactive
2 | 3v9bn4y | active
2 | 6f9ftfx | active
In that case i want to get the WIFI spot that has the less active users in it based on status.
So even if there was many inactive users, those wouldn’t be counted.
P.S. In the example, the result would be the Spot 1.
1 Answer