"lista użytkowników LMS" lms@lists.lms.org.pl napisał(a):
On Sun, 09 Nov 2008 15:23:41 +0100, usrobo wrote
Witam!
Mam prośbę o pomocy w modyfikacji zapytania sqlowego
te zapytanie $dbq = $dbase->prepare("SELECT customerid, SUM(uprate) AS uprate, SUM(downrate) AS downrate, SUM(upceil) AS upceil, SUM(downceil) AS downceil FROM assignments, customers, tarifs WHERE customers.id = customerid AND deleted = 0 AND tariffid = tariffs.id AND (datefrom <= $utsfmt OR datefrom = 0) AND (dateto > $utsfmt OR dateto = 0) GROUP BY customerid")
SELECT assignments.customerid AS customerid, SUM(uprate) AS uprate, SUM(downrate) AS downrate, SUM(upceil) AS upceil, SUM(downceil) AS downceil FROM assignments, customers, tarifs LEFT JOIN customerassignments ON customerassignments.customerid = assignments.customerid WHERE customers.id = assignments.customerid AND customergroupid = 3 AND deleted = 0 AND tariffid = tariffs.id AND (datefrom <= $utsfmt OR datefrom = 0) AND (dateto > $utsfmt OR dateto = 0) GROUP BY assignments.customerid
Błąd
zapytanie SQL: Dokumentacja
SELECT assignments.customerid AS customerid, SUM( uprate ) AS uprate, SUM( downrate ) AS downrate, SUM( upceil ) AS upceil, SUM( downceil ) AS downceil FROM assignments, customers, tariffs LEFT JOIN customerassignments ON customerassignments.customerid = assignments.customerid WHERE customers.id = assignments.customerid AND customergroupid =3 AND deleted =0 AND tariffid = tariffs.id AND ( datefrom <=1212271200 OR datefrom =0 ) AND ( dateto >1283291999 OR dateto =0 ) GROUP BY assignments.customerid LIMIT 0 , 50
MySQL zwrócił komunikat: Dokumentacja #1054 - Nieznana kolumna 'assignments.customerid' w on clause
w bazie jest taka kolumna
!DSPAM:4917011a208781310814384!