开发者

Error while executing the following mysql query

select name from movie as d
where d.mov = movie.mov;

. ERROR 1054 (42S22): Unknown column 'd.mov in 'where clause开发者_Go百科' . i sure that column mov exist.

but this is true

select name from movie as d
where d.mov = mov;


When you define an alias for a table you always have to use that alias.

The first query does not work because once you have defined the alias, that table is now only accessible using that alias.

The second query works because leaving out the table/alias prefix is legal as long as the column name is unique.


"movie" or "moive"? (Concise, accurate, but too short for an answer.)


if

select name from moive as d
where d.mov = mov;

is true, than I guess you should write

select name from moive as d
where d.mov = moive.mov;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜