Skip to content
Advertisement

How to solve this invalid select list?

Can anyone have any suggestions on what I’m missing on my query.

I’m having error:

Msg 8120, Level 16, State 1, Line 6 Column ‘Cars.dbo.tblTranslateTable.IDEvent’ is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

I wanted to select the count of rows from the translate table, idevent and the date referencing from another table.

SELECT COUNT (*) Entries, T.auctionevent,TT.auctiondate 
FROM iDP.dbo.tblTranslateTable T 
INNER JOIN iDx.dbo.tblAuctionEvent TT ON T.AuctionEvent = TT.AuctionEvent
GROUP BY T.auctionevent 

Advertisement

Answer

SELECT COUNT (*) Entries, T.auctionevent,TT.auctiondate 
FROM iDP.dbo.tblTranslateTable T 
INNER JOIN iDx.dbo.tblAuctionEvent TT ON T.AuctionEvent = TT.AuctionEvent 
GROUP BY T.auctionevent ,TT.auctiondate
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement