I have created an user defined function [GetUniqueOppbyDealer] and want to add it in the select clause as a column.
Can you help me on
1)check if my query is correct with the user defined function
2)In [GetUniqueOppbyDealer] , its dealerid and date have to be controlled by the where conditions from the main dataset.
select sum(ad.[WidgetInteraction]) as pencils,
mmd_feed.[dbo].[GetUniqueOppbyDealer] as uniqueopportunity
from makemydeal_com.[dbo].[adobe_Standard] ad
inner join cte cte on cte.dealerid=ad.dealerid
and date between '2015-04-01' and '2015-05-15'
group by cte.dealstarts, cte.alternatedeals, cte.createddeals