470,636 Members | 1,599 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

how this query should be in mysql 5

Hello,

I have query which work in mysql 4
In mysql 5 I have error 1054.

this is this query:
select
count(p.products_id) as total

from
products_description pd, products p
left join manufacturers m on p.manufacturers_id = m.manufacturers_id,
products_to_categories p2c left join specials s on p.products_id =
s.products_id

where
p.products_status = '1'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
and pd.language_id = '1'
and p2c.categories_id = '21'

-----------------------------

how change it to mysql 5 ??
thanks

Apr 24 '06 #1
1 1048
da************@wp.pl wrote:
from
products_description pd, products p
left join manufacturers m on p.manufacturers_id = m.manufacturers_id,
products_to_categories p2c left join specials s on p.products_id =
s.products_id how change it to mysql 5 ??


They changed the rules of order of evaluation in FROM clauses in MySQL5,
to bring the semantics closer to the ANSI standard SQL.

You can solve this by using parentheses, or you can use SQL-92 JOIN
syntax throughout. For example:

FROM
products p
JOIN products_to_categories p2c ON p.products_id = p2c.product_id
JOIN products_description pd ON p2c.products_id = pd.products_id
LEFT JOIN manufacturers m ON p.manufacturers_id = m.manufacturers_id
LEFT JOIN specials s ON p.products_id = s.products_id

Regards,
Bill K.
Apr 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Paradigm | last post: by
3 posts views Thread by Paradigm | last post: by
reply views Thread by Murphy | last post: by
5 posts views Thread by deaconj999 | last post: by
1 post views Thread by Korara | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.