I need to run a query, and Im not sure if it's possible. I could do 2 queries but one is better right :|
I have two tables. First is user, this consists of username and userid. The second is search which consists of userid and query. When I select the search table I want user ID to be replaced by username by taking the data from the user table. Is this making sence?
+-------+----------+
|userid | username |
+-------+----------+
| 1 | foo1 |
+-------+----------+
| 2 | foo2 |
+-------+----------+
| 3 | foo3 |
+-------+----------+
| 4 | foo4 |
+-------+----------+
+-------+----------+
|userid | query |
+-------+----------+
| 1 | blah1 |
+-------+----------+
| 2 | blah2 |
+-------+----------+
| 3 | blah2 |
+-------+----------+
| 4 | blah2 |
+-------+----------+