Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

how this query should be in mysql 5

 
   Database Forums (Home) -> mySQL RSS
Next:  Forms future  
Author Message
daniel.czestki

External


Since: Jan 04, 2006
Posts: 1



(Msg. 1) Posted: Mon Apr 24, 2006 1:18 am
Post subject: how this query should be in mysql 5
Archived from groups: mailing>database>mysql (more info?)

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

 >> Stay informed about: how this query should be in mysql 5 
Back to top
Login to vote
Bill Karwin1

External


Since: Jun 17, 2004
Posts: 388



(Msg. 2) Posted: Mon Apr 24, 2006 12:22 pm
Post subject: Re: how this query should be in mysql 5 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

daniel.czestki RemoveThis @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.

 >> Stay informed about: how this query should be in mysql 5 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Query Across DBs in MySQL - Hi I'm new to MySQL and am wanting to be connected to the MySQL server and query across diffrent db's. To my understanding a different db in MySQL is the same as a schema in Oracle. Am I correct in this thinking? What I want is to have one DB called..

mysql query optimization - I'm having some problems optimizing this q&#118;ery: select distinct l2.* from linetmp l1, linetmp l2 where l1.fname = "" and left(l1.id,3)<> "S&#85;B" and l2.fname <> "" and (l1.n1 = l2.n1 or l1.n1 = l2...

query kills mySQL db - I have a query that seems to kill the db for our website (causes the 'Too many connections' error). I would like to avoid this! Is there a way to test the query before the db goes down? I do not have access to a staging environment. I can access the db....

DB2 to MySQL query converter - Does such a thing exist? I have the following DB2 query I need to rewrite to work with MySQL and am having trouble: SELECT DAY(`DATE`), CASE WHEN STATUS='O' OR STATUS='N' OR STATUS='V' OR STATUS='H' OR STATUS='P' OR STATUS='C' OR STATUS='M' THEN 'O'..

(Mysql 3.23] Query with SUM wrong - Hi, Well the following query is not the one i will use but it's the same prob : SELECT sum(country_id ) , count( country_id ) FROM Tbl_Country, Tbl_config WHERE country_id =1 Well ...the result should be sum(country_id )= 1 et count( country_id ) =....
   Database Forums (Home) -> mySQL All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]