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
Santosh Kumar
NA
126
60k
HOW TO AVOID THE GROUP BY FOR ALL COLUMNS IN SELECTSTATEMENT
Jul 16 2013 9:32 AM
SELECT a.Name,
a.id,
a.Type,
a.date,
COUNT(b.pac),
a.ConName
FROM TableA a
JOIN TableB b ON a.Taskgenid = b.Taskgenid
AND a.formgenid = b.formgenid
JOIN TableC c ON A.id = c.ID
JOIN TableD d ON D.Typeid = c.Typeid
WHERE a.date BETWEEN @Begindate AND @Enddate
AND a.type IN (1, 2, 3)
GROUP BY a.Name,
a.id,
a.Type,
a.date,
a.ConName
I doesnt want to group the columns a.id,a.type,a.date,a.conname. If i remove those columns it showing error that a.id, a.type,a.date,a.conname is not group by or aggregate.
I want only Count(b.pac)
Reply
Answers (
7
)
copy a table data from a database on another one server
A network related or instance specific error in sql server