I have the following 3 data tables
Options Table
UID (pk) SID (pk) TID (pk)
--------------------------
1 20 2
1 20 3
1 13 3
1 14 4
Types Table
TID (pk) TText
--------------------------
1 Text 1
2 Text 2
3 Text 3
4 Text 4
Sets Table
SID (pk) SText
--------------------------
13 Set 13
14 Set 14
20 Set 20
I am trying to get the output as follows, with only 4 rows from the options table, but with the corresponding text from the other 2 tables. My joins seems to be off tho.
The result I want is:
UID (pk) SID (pk) TID (pk) SText TText
------------------------------------------------------
1 20 2 Set 20 Text 2
1 20 3 Set 20 Text 3
1 13 3 Set 13 Text 3
1 14 4 Set 14 Text 4
UPDATE 1
add
DISTINCT