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
 Msg 102, Level 15, Incorrect syntax near '<'

Author  Topic 

asdf_qwer
Starting Member

2 Posts

Posted - 2010-07-24 : 07:32:50
Hello,

Am getting error Msg 102, Level 15. Incorrect syntax near '<' when i tried to categorize the salary levels in the following code. Am very new to sql, please help!

create procedure sp_Sal_Level
as
begin
select fname,lname,dept,salary,SalaryLevel=
case salary
when salary<=100000
then 'Very Low'
when salary>100000 and salary<=300000
then 'Low'
when salary>300000 and salary<=700000
then 'Medium'
when salary>700000 and salary<=1200000
then 'High'
when salary>1200000
then 'Very High'
end
from emp1
end

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-24 : 07:38:41
quote:
Originally posted by asdf_qwer

Hello,

Am getting error Msg 102, Level 15. Incorrect syntax near '<' when i tried to categorize the salary levels in the following code. Am very new to sql, please help!

create procedure sp_Sal_Level
as
begin
select fname,lname,dept,salary,SalaryLevel=
case salary
when salary<=100000
then 'Very Low'
when salary>100000 and salary<=300000
then 'Low'
when salary>300000 and salary<=700000
then 'Medium'
when salary>700000 and salary<=1200000
then 'High'
when salary>1200000
then 'Very High'
end
from emp1
end






No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

asdf_qwer
Starting Member

2 Posts

Posted - 2010-07-25 : 07:11:38
Thanks a lot webfred
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-07-25 : 07:48:21
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -