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
ToBe
NA
164
94.4k
SQL server Group by error
Jan 8 2014 4:33 AM
hi All,
I have this query I need to return Books with its category
SELECT BOOKS.NO,
BOOKS.NAME,
BOOKS.COUNTRY,
SELECTED_CATEGORY.CATEGORY_ID,
CATEGORY.CATEGORY_NAME
FROM SELECTED_CATEGORY INNER JOIN
BOOKS ON SELECTED_CATEGORY.CATEGORY_ID = BOOKS.NO INNER JOIN
CATEGORY ON SELECTED_CATEGORY.CATEGORY_ID = CATEGORY.ID
Group by BOOKS.NO;
each Book has multiple categories , i used for that purpose the group by option in SQL but it gives me an error
Msg 8120, Level 16, State 1, Line 1
Column 'BOOKS.NAME' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Reply
Answers (
5
)
query help ???
Stateful in SQL Server