我不明白为什么列'RECNO'在组声明中是不明确的
[SQL] SELECT `d`.`FATURA_DURUM` AS `FATURA_DURUM`,
`i`.`RECNO` AS `RECNO`,
`i`.`BOLGE` AS `BOLGE`,
`m`.`MUSTERI_UNVANI` AS `MUSTERI_UNVANI`,
`i`.`MUSTERI_NO` AS `MUSTERI_NO`,
`i`.`HAKEDIS_ONAY_PERSONEL` AS `HAKEDIS_ONAY_PERSONEL`,
`i`.`ISEMRI_NO` AS `ISEMRI_NO`,
`s`.`ADRES_EMAIL` AS `ADRES_EMAIL`,
`i`.`RECNO` AS `ISEMRI_RECNO`,
`i`.`SERVIS_BAS_TAR` AS `SERVIS_BAS_TAR`,
`i`.`SERVIS_BIT_TAR` AS `SERVIS_BIT_TAR`,
`i`.`URUN_CIHAZ_ADI` AS `URUN_CIHAZ_ADI`,
`i`.`URUN_MARKA_ADI` AS `URUN_MARKA_ADI`,
`i`.`URUN_MODEL_ADI` AS `URUN_MODEL_ADI`,
`i`.`ONAY_DURUM` AS `ONAY_DURUM`,
`i`.`HAKEDIS_DURUM` AS `HAKEDIS_DURUM`,
`i`.`HAKEDIS_FATURANO` AS `HAKEDIS_FATURANO`,
`i`.`URUN_SERI_NO` AS `URUN_SERI_NO`,
`s`.`FIRMA_UNVANI` AS `FIRMA_UNVANI`,
`i`.`YAPILANLAR_M` AS `YAPILANLAR`,
st.serino_count
FROM (((`isemri` `i`
left join `musteri_tan` `m` on ((`i`.`MUSTERI_RECNO` = `m`.`RECNO`)))
join `isemri_det` `d` on ((`i`.`RECNO` = `d`.`ISEMRI_RECNO`)))
join `servisler` `s` on ((`i`.`BOLGE` = `s`.`BOLGE_NO`)))
left join
(select URUN_SERI_NO as URUN_SERI_NO2, count(*) as serino_count from ISEMRI
group by URUN_SERI_NO) as st on (st.URUN_SERI_NO2 = i.URUN_SERI_NO) WHERE 1 = 1 and `i`.HAKEDIS_DURUM=0 and `i`.ONAY_DURUM != 1 and (`i`.SERVIS_BAS_TAR between '2011-02-01 00:00:00' and '2011-09-19 23:59:59' ) and `i`.BOLGE=710 group by `i`.`RECNO`,
`m`.`MUSTERI_UNVANI`,
`i`.`MUSTERI_NO`,
`i`.`ISEMRI_NO`,
`i`.`SERVIS_BAS_TAR`,
`i`.`SERVIS_BIT_TAR`,
`i`.`URUN_CIHAZ_ADI`,
`i`.`URUN_MARKA_ADI`,
`i`.`URUN_MODEL_ADI`,
`i`.`ONAY_DURUM`,
`i`.`HAKEDIS_DURUM`,
`i`.`HAKEDIS_FATURANO`
and ( (FATURA_DURUM LIKE '%ayten%' OR RECNO LIKE '%ayten%' OR FIRMA_UNVANI LIKE '%ayten%' OR MUSTERI_UNVANI LIKE '%ayten%' OR SERVIS_BAS_TAR LIKE '%ayten%' OR SERVIS_BIT_TAR LIKE '%ayten%' OR URUN_CIHAZ_ADI LIKE '%ayten%' OR URUN_MARKA_ADI LIKE '%ayten%' OR URUN_MODEL_ADI LIKE '%ayten%' OR ONAY_DURUM LIKE '%ayten%' OR HAKEDIS_DURUM LIKE '%ayten%' OR serino_count LIKE '%ayten%' OR HAKEDIS_FATURANO LIKE '%ayten%' OR URUN_SERI_NO LIKE '%ayten%' OR YAPILANLAR LIKE '%ayten%') ) order by `i`.RECNO desc
[Err] 1052 - Column 'RECNO' in group statement is ambiguous编辑:上面的代码来自Navicat。这里是PHP的错误:
Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'RECNO' in group statement is ambiguous' in D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\Zend\Db\Statement\Pdo.php:238
Stack trace:
#0 D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\Zend\Db\Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\Zend\Db\Adapter\Abstract.php(467): Zend_Db_Statement->execute(Array)
#2 D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\Zend\Db\Adapter\Pdo\Abstract.php(235): Zend_Db_Adapter_Abstract->query('SELECT `d`.`FAT...', Array)
#3 D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\DoDb.php(260): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `d`.`FAT...')
#4 D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\DoDb.php(163): DoDb::printJsonDG('SELECT `d`.`FAT...', Object(Zend_Db_Adapt in D:\Programs\xampp\htdocs\www\app\httpdocs\Application\System\Library\Zend\Db\Statement\Pdo.php on line 238