I have a stored procedure for returning data in one row with sub query,but i am getting a error that
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
I am providing you my stored procedure please check and give me solution.
CREATE proc [dbo].[GetChartDetails]
@type varchar(50)
as
begin
select
(select SUM(PaidAmt)as LifeInsurance, DATENAME(MONTH, CreateDate) Month_name from CutomerPaymentDetail where categorytype='LIFE INSURANCE' and type=@type group by DATENAME(MONTH, CreateDate)) ,
(select SUM(PaidAmt)as GIC ,DATENAME(MONTH, CreateDate) Month_name from CutomerPaymentDetail where categorytype='GIC' and type=@type group by DATENAME(MONTH, CreateDate)) ,
(select SUM(PaidAmt)as MutualFund ,DATENAME(MONTH, CreateDate) Month_name from CutomerPaymentDetail where categorytype='MUTUAL FUND' and type=@type group by DATENAME(MONTH, CreateDate))
end

Mageshwaran RPosted Nov 14, 2019, 12:11 PM
Jignesh KumarPosted Jun 25, 2019, 11:33 PM
Suraj KumarPosted Jun 25, 2019, 2:55 AM
Madan ShekarPosted Jun 25, 2019, 2:37 AM