TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Apurva Singh
NA
268
57.5k
sub query with group by
Jun 25 2019 12:58 AM
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
Reply
Answers (
4
)
SSrs report Sl no need to dsiplay
How Many Queries can hit on a single database in a day