sql - Using temp column to filter the results -
my query this.
select id,name,salary,(salary-2000) [deductedsalary] employeedetails
i want use [deductedsalary] column in clause, similar below query.
select id, name, salary, (salary-2000) [deductedsalary] employeedetails [deductedsalary] > 5000
note: don't want use filter query 'salary' column
you can use subquery define alias:
select * ( select salary-2000 deducted_salary , * employeedetails ) subqueryalias deductedsalary > 5000
Comments
Post a Comment