Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how can i select my assigned fields in own query?

Author  Topic 

mic_02_02
Starting Member

2 Posts

Posted - 2009-09-23 : 23:52:36
hi . i just want to ask how can i select my assigned fields in own query?

example:

"SELECT (Salary*50) As Salary1, (Salary1-2) As Salary2 in tblEmployees"

SQL error ='Unknown Column Salary1 in field list!'

Please help for alternatives.. thanks!

nirene
Yak Posting Veteran

98 Posts

Posted - 2009-09-24 : 00:51:24
Select (Salary1-2) as Salary2 from (SELECT (Salary*50) As Salary1 from tblEmployees) A

Hope this helps

Nirene
Go to Top of Page

mic_02_02
Starting Member

2 Posts

Posted - 2009-09-24 : 02:01:14
hi Nirene, thnks for the code!
Go to Top of Page
   

- Advertisement -