OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Update Join with Aliases

From: Elissa Joan (ejbrighterearth.com)
Date: Fri Nov 30 2007 - 11:05:29 CST


Hello.

I am having a time trying to get this to work. I hope someone can help me wit the syntax!

Here is the original query:

 UPDATE ambien_nev.Sections
INNER JOIN ambien_nev.Sections ON natural_db.Sections.section_id = ambien_nev.Sections.section_id
SET ambien_nev.Sections.feature1 = natural_db.Sections.feature1,
ambien_nev.Sections.feature2 = natural_db.Sections.feature2,
ambien_nev.Sections.feature3 = natural_db.Sections.feature3,
ambien_nev.Sections.feature4 = natural_db.Sections.feature4,
ambien_nev.Sections.banner_image = natural_db.Sections.banner_image;

Which gives the message: Not unique table/alias: 'Sections'

So I tried aliases:

UPDATE ambien_nev.Sections as SectionsSp
INNER JOIN SectionsSp ON natural_db.Sections.section_id = SectionsSp.section_id
SET SectionsSp.feature1 = natural_db.Sections.feature1,
SectionsSp.feature2 = natural_db.Sections.feature2,
SectionsSp.feature3 = natural_db.Sections.feature3,
SectionsSp.feature4 = natural_db.Sections.feature4,
SectionsSp.banner_image = natural_db.Sections.banner_image

Which gives the message: Not unique table/alias: 'SectionsSp'

Help! And a million thanks in advance for any help.