•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 456,559 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,457 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 488 | Replies: 1
![]() |
| |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I have a problem. I have questions, to a question there can be arbitrary groups and to every group there can be arbitrary conditions. To have permission to “see” an question you have to have at least one condition from every group which is in the question.
I have three tables: Question, QuestionGroup and GroupCondition.
Question
QuestionId | Bla | Bla
15 | as | asd
16 | ef | asdas
QuestionGroup
fkey_GroupID | fkey_QuestionID
1 | 15
2 | 15
3 | 16
GroupCondition
Pkey_GroupId | fkey_ConditionId
1 | 101
1 | 102
2 | 103
3 | 101
3 | 102
3 | 103
So I need a select which returns all QuestionId from Question depending on the conditions I have. So to get QuestionId (15) I need following: (101 or 102) and (103), to get acess to QuestionId 16 I need (101 or 102 or 103). I hope I have been clear enough..
I do not know if it is sql server 2000 or 2005 its goint to be on.
Best regards
carl
I have a problem. I have questions, to a question there can be arbitrary groups and to every group there can be arbitrary conditions. To have permission to “see” an question you have to have at least one condition from every group which is in the question.
I have three tables: Question, QuestionGroup and GroupCondition.
Question
QuestionId | Bla | Bla
15 | as | asd
16 | ef | asdas
QuestionGroup
fkey_GroupID | fkey_QuestionID
1 | 15
2 | 15
3 | 16
GroupCondition
Pkey_GroupId | fkey_ConditionId
1 | 101
1 | 102
2 | 103
3 | 101
3 | 102
3 | 103
So I need a select which returns all QuestionId from Question depending on the conditions I have. So to get QuestionId (15) I need following: (101 or 102) and (103), to get acess to QuestionId 16 I need (101 or 102 or 103). I hope I have been clear enough..

I do not know if it is sql server 2000 or 2005 its goint to be on.
Best regards
carl
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Installing Windows 98 On VMware. Floppy problem (Windows 9x / Me)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP / 2003)
- Redhat Linux 6.2 - ipop3d problem? (*nix Software)
- Problem with T720 (Gadgets and Gizmos)
- Connection Problems (Networking Hardware Configuration)
- Encoding (Unicode) problem in IE 6.0 (Web Browsers)
- .htaccess mod_rewrite problem (Linux Servers and Apache)
- Javascript/HTML problem!!! (JavaScript / DHTML / AJAX)
- Problem with Windows Update and WinXP (Web Browsers)
Other Threads in the MS SQL Forum
- Previous Thread: Referencing using T-SQL?
- Next Thread: 'There is already an object named 'ProductID' in the database.'



Hybrid Mode