Well, the problem is that I have 2 tables with data and one lookup table that are similar to this:
componenttype
+-----+----------+
| ID | Type |
+-----+----------+
| 1 | Device1 |
+-----+----------+
| 2 | Group1 |
+-----+----------+
component
+-----+------+-------------+
| ID |TypeID| Version |
+-----+------+-------------+
| 1 | 2 | 3.0.0 |
+-----+------+-------------+
| 2 | 2 | 3.0.1 |
+-----+------+-------------+
| 3 | 1 | 5.12.23 |
+-----+------+-------------+
lookup
+-----+------+
|GID | DID |
+-----+------+
| 1 | 3 |
+-----+------+
I want to return something like this:
+--------+-------+---------+---------+
| Type | G Ver | Type | D Ver |
+--------+-------+---------+---------+
| Group1 | 3.0.0 | Device1 | 5.12.23 |
+--------+-------+---------+---------+
I am trying to return which devices are part of which group, but my devices and groups are in the same table.
The lookup table says GID = 1 AND DID = 3. The query would SELECT elements from the component table (GID = 1 AND DID = 3) WHERE component.typeID = componenttype.ID
The problem is that I am trying to retrieve and display 2 different types from the componenttype table in the same row. Can this be done?