sumproduct within sql query
976439Dec 14 2012 — edited Dec 17 2012Hi, i was looking for some help trying to replicate a sumproduct function in Excel to SQL.
I have a list of names that are not unique from Column A1 onwards and a count of how many times these appear from Column B1 onwards.
I then have a list of unique names from column D1 (shown below) and the formula =SUMPRODUCT(($A:$A=D1)*(B:B=1)).
A
B
C
D
E
This gives me the information for all names that have only appeared once in Column A. I am now trying to replicate this formula into an SQL query but not sure where to start. I know it might be too much of an ask but if I could get an example of how something like this can be written in SQL than that would be very helpful.
If somebody can help, would really appreciate it.
Thanks in advance.