13, February 2012

help! Join problem after upgrade to mysql version 5 - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: help! Join problem after upgrade to mysql version 5
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: help! Join problem after upgrade to mysql version 5  (Read 2775 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: May 12, 2007, 04:56:47 pm »

Hi,

I have this SQL statement:

Code:
SELECT DISTINCT ss.id, ss.price
FROM tpl_screenshots4 AS ss, tpl_keywords AS kw
LEFT JOIN tpl_categorie_links AS cat ON ss.id = cat.tpl_id
WHERE ss.id = kw.tpl_id AND cat.category = 76
ORDER BY ss.date_added DESC

this works fine in mysql 4.xx but not in mysql 5

I get this strange error:
Quote
#1054 - Unknown column 'ss.id' in 'on clause'

is there something changed in this version what I didn't know?


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5778
46265 credits
Members referred : 3



« Reply #1 on: May 12, 2007, 05:08:58 pm »

What about this?

Code:
SELECT DISTINCT tpl_screenshots4.id, tpl_screenshots4.price
FROM tpl_screenshots4 , tpl_keywords AS kw
LEFT JOIN tpl_categorie_links AS cat ON tpl_screenshots4.id = cat.tpl_id
WHERE ss.id = kw.tpl_id AND cat.category = 76
ORDER BY tpl_screenshots4.date_added DESC

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: May 12, 2007, 06:58:21 pm »

I don't think that this is the solution, check this:

http://dev.mysql.com/doc/refman/5.0/en/left-join-optimization.html


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5778
46265 credits
Members referred : 3



« Reply #3 on: May 12, 2007, 07:51:40 pm »

I don't get it. What's the problem?

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 12, 2007, 07:56:21 pm »

I don't get it. What's the problem?
mysql 5 has some new rules for joins Smiley


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5778
46265 credits
Members referred : 3



« Reply #5 on: May 12, 2007, 08:06:14 pm »

I guess this is only for LEFT JOIN, as INNER JOIN statements work as before.

Maybe we need to read some theory again Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: May 13, 2007, 10:36:50 am »

according the manual it should be:

Code:
SELECT DISTINCT ss.id, ss.price
FROM tpl_screenshots4 AS ss
JOIN tpl_keywords AS kw
LEFT JOIN tpl_categorie_links AS cat ON (ss.id = cat.tpl_id)
WHERE ss.id = kw.tpl_id AND cat.category = 64
ORDER BY ss.date_added DESC

and it works (very fast)

I think we need ro learn more about optimization of queries in the new mysql version  Wink


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5778
46265 credits
Members referred : 3



« Reply #7 on: May 14, 2007, 01:18:35 pm »

I still don't use mysql 5.0 to production servers, but I worked with it for one big project and I was really impressed with how fast is it, especially with big databases.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: May 14, 2007, 01:56:20 pm »

I still don't use mysql 5.0 to production servers, but I worked with it for one big project and I was really impressed with how fast is it, especially with big databases.
yeah right its really fast, I think I will store the youtube data in the database and stop with the cache files


Last blog : A new Wordpress theme for our blog
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #9 on: May 14, 2007, 01:57:52 pm »

btw. mysql5 is a little older the future is mysql6

I stopped the development on mysql3 a few month ago


Last blog : A new Wordpress theme for our blog
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6562
Tags : mysql5 left join Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases  >  MySQL
Topic: help! Join problem after upgrade to mysql version 5
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Feb 13, 2012, 09:21:18 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.