Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at cf.Objective() 2011 (Minneapolis, MN) with: Karsten Pearce
Ben Nadel at cf.Objective() 2011 (Minneapolis, MN) with: Karsten Pearce@vexeddeveloper )

MySQL: The Multi-part Identifier "" Could Not Be Bound

By Ben Nadel on
Tags: SQL

I had never seen this error before, so I thought I would just take a second to post it in case anyone tries to Google it. Luckily, my query was extremely small and so the error was obvious from a quick review of the SQL; but, in a large query this might not be readily apparent. Here's the kind of query I was running in MySQL:

  • [user]
  • SET
  • is_active = 1
  • = 4

Can you see what the problem is? My WHERE clause uses an aliased table name, but my UPDATE clause did not alias the table. I am so used to using aliased tables that when I saw the error, it didn't even occur to me that the aliasing itself was causing the issue. Once I removed the alias "u.", the query worked fine.

Again, a really minor note, but I thought it might help someone.

Reader Comments


Agreed; I try to use the alias all the time. I just like it for some reason - I think it adds readability to the query (although that may just be a purely emotional response).

Ah this helped me a lot, mine query was big one and I did aliased the table but after reading this when I checked back the query, there was a typo in alias. :-) So lots of time saved.

I have meet the same question,but I don't think the origin error is the alias but the alias the way use it ,I recommened the way you use it like this:
SET u.is_active = 1
from users as u