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 |
dsousa187
Starting Member
2 Posts |
Posted - 2012-08-14 : 01:13:11
|
How could I translate this SQL query in MS access into SQL SERVER query or t_SQL.SELECT student.district, Sum(IIf([educlevel]="Primary",1,0)) AS PrimaryFROM student GROUP BY student.district; |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-14 : 01:23:12
|
[code]SELECT student.district, Sum(CASE WHEN [educlevel]="Primary" THEN 1 ELSE 0 END) AS PrimaryFROM student GROUP BY student.district;[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-14 : 01:24:05
|
and one more thingIIF is available in SQL from 2012 version onwards------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|