有表store,结构如下name | sale | sdate
1 1000 1
2 2000 2
3 2555 3有如下SQL语句,
select name,sale salary from store where salary <= 2000
返回几条数据,为什么?
1 1000 1
2 2000 2
3 2555 3有如下SQL语句,
select name,sale salary from store where salary <= 2000
返回几条数据,为什么?
汗..不能用别名...select name,sale from store where sale <= 2000得到2条...
--想要别名的话 可以考虑嵌套select * from (select name,sale salary from store) where salary <= 2000
--你的条件符号的也就只有两条,不知问什么
select name,sale from store where sale <= 2000;
会返回2条记录
form -> where -> select 所以在where 中使用别名他不能识别