mySql - Abfrage geht nicht

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

mySql - Abfrage geht nicht

Postby tscharlie » 21. November 2005 15:49

Hier gleich mein Problem:
1054 - Unknown column 'p.products_id' in 'on clause'

select distinct p.products_date_added, p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c INNER JOIN products_to_stores p2s ON p.products_id = p2s.products_id where p2s.stores_id = '2' and p.products_date_added > '2005-09-21 15:09:18' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '1100' and p.products_status = '1' order by p.products_date_added desc limit 9

wenn ich diese Abfrage bei meinem Hoster eingeben -> bekomme ich ein Ergebniss ->
auf meinem Localhost (Xampp) mit der gleichen DB bekomme ich diese Fehlermeldung!

kann mir jemand einen Tipp geben warum?
tscharlie
 
Posts: 2
Joined: 21. November 2005 15:25

Postby tscharlie » 22. November 2005 09:37

Habe mich noch etwas damit beschäftigt und festgestellt.

die Abfrage hat kein Eregebnis!

jetzt möchte ich wissen warum unter Mysql 4.0.15 die Abfrage erfolgreich ausgeführt wird.

und bei Mysql 5.0.15 es zu so einer Fehlermeldung kommt.

und natürlich wie ich das vielleicht abdrehen kann.

Wäre ganz toll-> wenn mir jemand helfen könnte, da ich noch ein Rookie bin auf diesem Gebiet :)
tscharlie
 
Posts: 2
Joined: 21. November 2005 15:25

Postby morpheus00de » 22. November 2005 23:32

Gleiches Problem hier... weiß jemand Rat???
morpheus00de
 
Posts: 10
Joined: 14. August 2005 06:33

Postby morpheus00de » 22. November 2005 23:58

Yo tscharlie,
gerade mein Problem gelöst.
Der Join Syntax scheint ab 5 verändert zu sein guck mal unter:
http://forum.mamboserver.com/showthread.php?t=61101

Speziell:
Code: Select all
The quickest way to fix this problem is change line 201 from

. "\n FROM #__categories AS cc, #__content AS c, #__sections AS s"

to

. "\n FROM (#__categories AS cc, #__content AS c, #__sections AS s)"

The difference is the parentheses to group the tables together. You'll only have this problem if your MySQL installation is using the SQL:2003 standard.

Hat bei mir gefunzt.
morpheus00de
 
Posts: 10
Joined: 14. August 2005 06:33


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 27 guests