Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update multiple ranges of info 1

Status
Not open for further replies.

szaunbr

Technical User
Jul 5, 2006
50
0
0
US
Hello, I am trying to update a pay field on multiple employees based on their job class. The job classes are spread out all over the place so I have a need to use both the 'in' command and 'between' or 'to' command. This is what I have:

update pay
set pay_amount = 732
where job in ('0101' to '0116', '0118' to '0120' .....)

I am getting a syntax error, which I understand, but I am not sure how to combine both the 'in' and 'to' commands together.

Maybe there is no way, but just checking.
 
Maybe in this way

update pay
set pay_amount = 732
where job between ('0101' and '0116') or job between( '0118' and '0120') .....
 
My mistake of course
update pay
set pay_amount = 732
where (job between '0101' and '0116') or (job between '0118' and '0120') .....
 
Thank you, that worked out great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top