Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Data Table namely Results
which have 5 columns
1-Session
2-Reg No
3-Course ID
4-Class ID
5-Exam ID----------------- have two types. (Mid Exam & Final Exam)
6-Obtained Marks

My question is that how can i select the records in two different coloumns from this table. i.e
Mid Exam Final Exam
68 70
70 70
i am using the query
Select [Obtained Marks] from Results where [Exam ID]=1. this query only retrieves MID Exam values not both, and when i typed [Exam ID]=2 then it retrieves Final Exam values. I want to retrieve both values in above mentioned format.

Please help!
Posted
Updated 15-Aug-15 9:40am
v2
Comments
[no name] 15-Aug-15 16:14pm    
Okay so if you do not need the WHERE clause to filter your results, then why have it?

1 solution

I agree with Wes.. if you want both, do not include the where clause and it will return all results.

If you need to have it you can use "WHERE [ExamId] IN (1,2)".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900