Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i wan to join two tables using join, and letting the user to order by ascending order with grouping the columns. When i was writing this statement no error but when i execute then i am getting an error saying
"Column 'TableName.ColumnID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.". Please explain me anyone

What I have tried:

SELECT FT.Column, FT.ColumnID
FROM FirstTable AS FT
JOIN SecondTable AS ST
ON FT.ColumnID = ST.ColumnID
GROUP BY FT.Column
ORDER BY FT.NUMBER ASC
Posted
Updated 20-Nov-18 23:18pm

1 solution

 
Share this answer
 
Comments
Member 8583441 21-Nov-18 5:30am    
Thank you problem is solved with this solution provided by you sir.
OriginalGriff 21-Nov-18 5:35am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900