O MySQL 5 está mais rígido quanto à leitura de queries. Por este motivo uma query que não esteja totalmente estruturada pode apresentar algum erro, o que não ocorre no MySQL 4, pois esta versão possui um tipo diferente de análise.
Vamos supor que você esteja executando a query abaixo:
SELECT count( DISTINCT p.products_id ) AS total FROM products p LEFT JOIN manufacturers m USING ( manufacturers_id ) , products_description pd LEFT JOIN specials s ON p.products_id = s.products_id, categories c, products_to_categories p2c WHERE p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '4' AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ( ( pd.products_name LIKE '%dvd%' OR p.products_model LIKE '%dvd%' OR m.manufacturers_name LIKE '%dvd%' ) )
Ela seria executada normalmente no MySQL 4, porém, ao executá-la no MySQL 5 ocorre o seguinte erro:
Para solucionar este problema é necessário realizar uma pequena mudança na estrutura da query removendo as tabelas existentes entre os JOIN’s e colocando-as logo após, deixando a query com uma estrutura mais lógica como mostra abaixo:
SELECT count( DISTINCT p.products_id ) AS total FROM products p LEFT JOIN manufacturers m USING ( manufacturers_id ) LEFT JOIN specials s ON (s.products_id = p.products_id), products_description pd, categories c, products_to_categories p2c WHERE p.products_status = '1' AND p.products_id = pd.products_id AND pd.language_id = '4' AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id AND ( ( pd.products_name LIKE '%dvd%' OR p.products_model LIKE '%dvd%' OR m.manufacturers_name LIKE '%dvd%' ) )
Qualquer dúvida em relação ao assunto, entre em contato conosco através do Atendimento
Veja também
I feel this is among the most significant information for me. And i am glad studying your article. But wanna observation on few general things, The web site style is ideal, the articles is actually nice : D. Good job, cheers
phpslot- World’s Top Online Casinos, new user welfare register bonus 66₱, daily Betting Rebate 2. fast withdraw, good bonus, variety of games, World brand is trustworthy. Slot games, Card games , Live Casino, Animals(Cockfight games), fishing.
Hey, I think your blog might be having browser compatibility issues. When I look at your blog in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!
Sweet blog! I found it while searching on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thank you
Hey there this is kind of of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding skills so I wanted to get advice from someone with experience. Any help would be enormously appreciated!
I am very happy to read this. This is the kind of manual that needs to be given and not the random misinformation that is at the other blogs. Appreciate your sharing this best doc.
Wonderful work! This is the type of info that should be shared around the internet. Shame on the search engines for not positioning this post higher! Come on over and visit my website . Thanks =)
That is very fascinating, You’re an overly professional blogger. I have joined your feed and stay up for seeking extra of your magnificent post. Also, I have shared your web site in my social networks!
I precisely had to say thanks once again. I do not know the things I could possibly have made to happen in the absence of the entire solutions shown by you relating to such a industry. This has been the difficult concern in my view, nevertheless spending time with the very skilled style you treated that forced me to weep for fulfillment. I’m just happier for the assistance and as well , sincerely hope you find out what a great job you were accomplishing training many people with the aid of your web page. Most likely you haven’t met all of us.
We are a gaggle of volunteers and opening a new scheme in our community. Your website provided us with helpful info to paintings on. You’ve performed an impressive process and our whole group can be thankful to you.
You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your blog.betflik
Great work! This is the type of info that should be shared around the net. Shame on the search engines for not positioning this post higher! Come on over and visit my site . Thanks =)
You are a very capable individual!
I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You’ve made my day! Thx again
Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your site? My website is in the exact same area of interest as yours and my visitors would really benefit from a lot of the information you present here. Please let me know if this ok with you. Thanks!
Wonderful web site. Plenty of helpful info here. I am sending it to a few friends ans also sharing in delicious. And of course, thank you for your sweat!
Good day! I just wish to give an enormous thumbs up for the nice data you’ve got right here on this post. I might be coming back to your blog for more soon.
You can definitely see your skills in the work you write. The world hopes for even more passionate writers like you who aren’t afraid to say how they believe. Always go after your heart.
Excellent post. I was checking constantly this blog and I’m impressed! Very useful info specifically the last part 🙂 I care for such info a lot. I was looking for this certain information for a long time. Thank you and best of luck.
Hello there, I found your blog via Google while looking for a related topic, your web site came up, it looks great. I’ve bookmarked it in my google bookmarks.
You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your blog.betflik
Thank you for another informative web site. Where else could I get that kind of information written in such a perfect way? I’ve a project that I am just now working on, and I’ve been on the look out for such info.
Fantastic blog you have here but I was curious about if you knew of any community forums that cover the same topics discussed in this article? I’d really like to be a part of online community where I can get feedback from other knowledgeable people that share the same interest. If you have any suggestions, please let me know. Cheers!