Hi guys,
Got an odd SQL string that I need to produce that is most probably simple to
construct but with it being hot in our office, I simply can't get my head
around it....!!
Its based around an online emailing facility whereby multiple hotels can be
emailed via a single application. Users within the application have access
rights to email only specific hotels.
The tables are laid out like this (irrelevant columns left out)...
CampaignID, CampaignName, CampaignHotelID s
1 Test Campaign 1,4,5,7,9
2 Test Campaign2 1,2
UserID, UserName, UserHotelIDAcce ss
1 Test User 1,6,7
2 Test User 2,7
Now on the stats page I want to give users access to view ONLY sent
campaigns to which they have access to view, I was considering the IN SQL
statement to achieve something like this...
'WHERE CampaignHotelID s IN UserHotelIDAces s'
....but that doesn't want to work, can anyone give me any ideas to get this
working within just a single SQL query?
Cheers, @sh
Got an odd SQL string that I need to produce that is most probably simple to
construct but with it being hot in our office, I simply can't get my head
around it....!!
Its based around an online emailing facility whereby multiple hotels can be
emailed via a single application. Users within the application have access
rights to email only specific hotels.
The tables are laid out like this (irrelevant columns left out)...
CampaignID, CampaignName, CampaignHotelID s
1 Test Campaign 1,4,5,7,9
2 Test Campaign2 1,2
UserID, UserName, UserHotelIDAcce ss
1 Test User 1,6,7
2 Test User 2,7
Now on the stats page I want to give users access to view ONLY sent
campaigns to which they have access to view, I was considering the IN SQL
statement to achieve something like this...
'WHERE CampaignHotelID s IN UserHotelIDAces s'
....but that doesn't want to work, can anyone give me any ideas to get this
working within just a single SQL query?
Cheers, @sh
Comment