Unix Technical Forum

The multi-part identifier could not be bound

This is a discussion on The multi-part identifier could not be bound within the MySQL forums, part of the Database Server Software category; --> Hello! Can someone tell me if this SQL-query is valid!? I ran it on two systems. On a "MySQL ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-28-2008, 05:41 AM
stefan.keul@googlemail.com
 
Posts: n/a
Default The multi-part identifier could not be bound

Hello!

Can someone tell me if this SQL-query is valid!? I ran it on two
systems.

On a "MySQL 4.1.11-Debian_4sarge7" I get an result but really slow.

Running the same query on a MsSql or Mysql5 on windows returns errors.

MSSQL ERROR: The multi-part identifier could not be bound
MYSQL: unknown column 'eca.filename' in ON clause

SELECT oec.messageid, oec.sendtime, oec.esubject, zt.emailadresse,
eca.filename
FROM emailcontentattachement eca, emailcontent oec
INNER JOIN ( SELECT messageid, emailadresse, type from emailrelations
WHERE messageid IN
( SELECT ec.messageid FROM emailcontent ec INNER JOIN emailrelations
er ON ec.messageid=er.messageid
INNER JOIN emailuserrelation eur ON
(er.emailadresse=eur.emailadresse)
INNER JOIN members m ON (eur.member_name=m.member_name AND
m.member_name='username') ) ) zt ON (zt.messageid=oec.messageid) AND
eca.filename LIKE '%doc%'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-28-2008, 05:41 AM
Peter H. Coffin
 
Posts: n/a
Default Re: The multi-part identifier could not be bound

On Thu, 27 Mar 2008 02:16:01 -0700 (PDT), stefan.keul@googlemail.com wrote:
> Hello!
>
> Can someone tell me if this SQL-query is valid!? I ran it on two
> systems.
>
> On a "MySQL 4.1.11-Debian_4sarge7" I get an result but really slow.


EXPN 'really slow'

Are we talking about hundreds and hundreds of ms or are we talking about
multiple hours?

> Running the same query on a MsSql or Mysql5 on windows returns errors.
>
> MSSQL ERROR: The multi-part identifier could not be bound
> MYSQL: unknown column 'eca.filename' in ON clause
>
> SELECT oec.messageid, oec.sendtime, oec.esubject, zt.emailadresse,
> eca.filename
> FROM emailcontentattachement eca, emailcontent oec
> INNER JOIN ( SELECT messageid, emailadresse, type from emailrelations
> WHERE messageid IN
> ( SELECT ec.messageid FROM emailcontent ec INNER JOIN emailrelations
> er ON ec.messageid=er.messageid
> INNER JOIN emailuserrelation eur ON
> (er.emailadresse=eur.emailadresse)
> INNER JOIN members m ON (eur.member_name=m.member_name AND
> m.member_name='username') ) ) zt ON (zt.messageid=oec.messageid) AND
> eca.filename LIKE '%doc%'


SHOW CREATE TABLE emailcontentattachement;

On both systems. I bet you find that that the tables are not the same.
Specifically, on of them doesn't have a column named `filename`.

--
Don't even get me started on the MCSEs I know. It's a miracle of
modern technology that some of these fsckwits still draw breath,
much less a paycheck.
-- Marc Bowden
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:18 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com