select username+'-'+userpwd as zd from user where zd='admin-1111' ,我用这个语句为什么出现 列名zd无效 的错误?
前面部分select username+'-'+userpwd as zd from user 是可以查询的
如何修改?
别名不能用在查询条件里吧。
select username+'-'+userpwd as zd from user where username+'-'+userpwd='admin-1111'
select username+'-'+userpwd as zd from user where username+'-'+userpwd='admin-1111'
温馨提示:答案为网友推荐,仅供参考
第1个回答 2010-07-15
zd 不能在where条件中使用
select username+'-'+userpwd as zd
from user
where username='admin'
and userpwd ='1111'
select username+'-'+userpwd as zd
from user
where username='admin'
and userpwd ='1111'
第2个回答 2010-07-15
select username+'-'+userpwd as zd from [user] where username+'-'+userpwd='admin-1111'