I have 3 tables
tblActivityResource
ActivityID [int] | ResourceID [int]
1 1
1 2
...
tblResource
ResourceID [int] | ResourceTypeID [varchar]
1 'ActivityOne'
2 'ActivityTwo'
tblResourceText
ResourceID [int] | LanguageCode [varchar] | ResourceText [ntext]
1 'EN' 'Activity 1 name'
2 'EN' 'Activity 1 description'
If I try the following I will obviously get 2 results
select ResourceID, ResourceText
from tblActivityResource a, tblResource b, tblResourceText c
where a.ActivityID = 1
and a.ResourceID = b.ResourceID
and b.ResourceID = c.ResourceID
Results...
ResourceID | ResourceText
1 | 'Activity 1 name'
2 | 'Activity 1 description'
How would I go about getting
ResourceID | ActivityName | Activity description
1 | 'Activity 1 name' | 'Activity 1 description'
Case statements?
tblActivityResource
ActivityID [int] | ResourceID [int]
1 1
1 2
...
tblResource
ResourceID [int] | ResourceTypeID [varchar]
1 'ActivityOne'
2 'ActivityTwo'
tblResourceText
ResourceID [int] | LanguageCode [varchar] | ResourceText [ntext]
1 'EN' 'Activity 1 name'
2 'EN' 'Activity 1 description'
If I try the following I will obviously get 2 results
select ResourceID, ResourceText
from tblActivityResource a, tblResource b, tblResourceText c
where a.ActivityID = 1
and a.ResourceID = b.ResourceID
and b.ResourceID = c.ResourceID
Results...
ResourceID | ResourceText
1 | 'Activity 1 name'
2 | 'Activity 1 description'
How would I go about getting
ResourceID | ActivityName | Activity description
1 | 'Activity 1 name' | 'Activity 1 description'
Case statements?