简体   繁体   中英

Add filter in stored procedure but give error invalid

When I add filter in my stored procedure, it throws an error "invalid column name".

My query is:

select name, monthlysalary as ms 
from Patient 
where ms = 2000;

You can not use aliases at where part

It should be like that.

select name, monthlysalary as ms from Patient where monthlysalary =2000;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM