Hatası almaktayım db ayarları 80 den 90 a getirdim.yani 2000 den 2005 getirdim.
aynı cümle 2000 de çalışıyor 2005 de bu hatayı veriyor.

Kod: Tümünü seç
create table myData(dealerid int ,vehicleid int, myCnt int) create table logcount(logid int, vendorid int, vid int) update mydata set mycnt=(select count(logid) from logcount where tbl.dealerid=vendorid and tbl.vehicleid=vid group by dealerid,vehicleid) FROM mydata tbl,logcount WHERE tbl.dealerid=logcount.vendorid AND tbl.vehicleid=logcount.vid
in sql 2005 I get this error message. This works on sql 2000. Why ?
Ref:ExpertsExchange
Each GROUP BY expression must contain at least one column that is not an outer referenceKod: Tümünü seç
UPDATE mydata SET mycnt = A.LOGCNT FROM mydata tbl INNER JOIN (SELECT vendorid, VID, COUNT(LOGID) LOGCNT FROM logcount GROUP BY vendorid, VID) A ON tbl.dealerid=A.vendorid AND tbl.vehicleid=A.vid
Kod: Tümünü seç
Compatibility level setting of 80 A GROUP BY clause in a subquery that
references a column from the outer query succeeds.
Compatibility level setting of 90 A GROUP BY clause in a subquery that
references a column from the outer query returns an error as per the SQL
standard.