how this query should be in mysql 5

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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

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

 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 =

 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 ??

Re: how this query should be in mysql 5 wrote:
Quoted text here. Click to load it

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:

  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

Bill K.

Site Timeline