I want to know what will be faster in this situation:
I have table1 = {ID, Type, BData, Quantity}
There are 2 type {A, B}
if I want to know sum of A, B
I can use this
but I can even use iif to do that :
my question is, which method will perform better ?
IIF or Where ?
I have table1 = {ID, Type, BData, Quantity}
There are 2 type {A, B}
if I want to know sum of A, B
I can use this
Code:
SELECT ID, Type, Month(Bdate) as M, Sum(Quantity) FROM Table1 Where Type like "A" Group by ID, Type, Month(Bdata);
Code:
SELECT ID, Month(BDate) as M, Sum(iif(Type like "a", Quantity, 0)) FROM Table1 Group by ID, Month(Bdate);
IIF or Where ?
Comment