Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
thanuksha
Starting Member
1 Post |
Posted - 2007-03-13 : 07:26:11
|
| How to check multiple conditions on a single column with and condition.Lets say theres a table with columns student No and subject.Data will be as follow.Student No Subject-------------- ----------00A Math00A Science00B Math00B Arts00C Science00D Math00D Science00D Atrs00E ScienceI want to get Students who are doing both Maths and Science. The results would be 00A and 00DPlease help me to solve this |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-13 : 07:51:53
|
[code]select [Student_No]from sometablewhere Subject in ('Maths', 'Science')group by [Student_No]having count(*) = 2[/code] KH |
 |
|
|
|
|
|