My question is how do I get 1 result from each result from Table1 for Table2? And not al results also from table2? I already searches stack overflow I found how to solve this with a id but I want to know how to do this with a Varchar column.
Table1
+--------------+-------------+
| Ip (Varchar) | Count (Int) |
+--------------+-------------+
| 1.1.1.1 | 9 |
| 1.1.1.2 | 6 |
| 1.1.1.3 | 1 |
+--------------+-------------+
Table2
+-------------+--------------+
| Name (Text) | Ip (Varchar) |
+-------------+--------------+
| User01 | 1.1.1.1 |
| User034 | 1.1.1.1 |
| User012 | 1.1.1.1 |
| User21 | 1.1.1.2 |
| User24 | 1.1.1.2 |
| User3 | 1.1.1.3 |
+-------------+--------------+
Wanted result
+--------+---------+-------+
| Name | Ip | Count |
+--------+---------+-------+
| User01 | 1.1.1.1 | 9 |
| User21 | 1.1.1.2 | 6 |
| User3 | 1.1.1.3 | 1 |
+--------+---------+-------+
It does not matter what name will be returned.
name
to keep? - AdamMc331