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
Arjun Dhilod
958
812
106.1k
getting error in sql when doing sum of two column
Oct 2 2018 7:28 AM
This sql query is not working the error are as below
"Each GROUP BY expression must contain at least one column that is not an outer reference".
Kindly help me if some know solution of it.
SELECT DISTINCT SUM(IncentiveBreakups.ActivationAmount + UniqueActivationAmount) AS Monthly,
IncentiveBreakups.ActivationAmount AS [Activation],
Case when Agents.JoiningDate >= '2018-10-01' THEN UniqueActivationAmount ELSE 0 END AS UniqueActivation
FROM Incentives
INNER JOIN IncentiveBreakups ON IncentiveBreakups.IncentiveID = Incentives.ID
INNER JOIN IncentiveSheets ON IncentiveSheets.ID = Incentives.IncentiveSheetID
INNER JOIN IncentiveSheetUsers ON IncentiveSheetUsers.IncentiveSheetID = IncentiveSheets.ID
INNER JOIN Achievements ON IncentiveSheetUsers.UserID = Achievements.UserID
INNER JOIN Agents ON Achievements.AgentID=Agents.ID
AND IncentiveBreakups.IncentiveID = Incentives.ID
AND IncentiveBreakups.Activations = (SELECT COUNT(DISTINCT Achievements.AgentID) AS Count FROM Achievements
WHERE CONVERT(DATE, Achievements.CreatedOn) BETWEEN '2018-09-01' AND '2018-09-30'
AND Achievements.UserID = 23
GROUP BY IncentiveBreakups.ActivationAmount,UniqueActivationAmount
HAVING SUM(CONVERT(FLOAT, Achievements.GWP)) > 8000)
Reply
Answers (
4
)
how to use angularjs routeparam
Unauthorized Error While Accesing Filpkart Marketplace API