not contained in aggregate function
Hi there
hoping someone can help:
I'm getting this error returned when I try and run this sql statement:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Column 'tbl_tenders.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
This is the statement:
SELECT t.id, t.title, t.address, t.area, t.detail, t.maplink, t.imagename, t.imagename_m, t.imagename2, t.imagename2_m, t.startdate, t.enddate, t.dateadded, MAX(b.bid) AS 'maxbid', b.biddate FROM tbl_tenders t, tbl_bid b WHERE t.IsLive = 0 AND t.id = b.tenderid AND b.customerid = 1
I'm not sure what I need to do here, why do I need a group by clause - can anyone advise?
thanks
Adam
|