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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New To SQL Need Help creating Update

Status
Not open for further replies.

civilwarjunky

IS-IT--Management
Aug 26, 2004
19
0
0
US
Hi - I am new to sql and I am in the need of an update.

I am looking to update my locations table using the following critera. I want to up date all records that have a countyid of 208 and have the following names.


Update Location
set districtid=285
where countyid=209
and location.name=Napa elem
or location.name=stagg elem
or loaction.name=Portola.
and so on.

This pulls duplicate names outside my critera.
can't I run a query for what I want and then update that query.? thanks
 
This should work:

[tt]
UPDATE
Location
SET
districtid = 285
WHERE
countyid = 209 AND
name IN ('Napa elem', 'stagg elem', 'Portola')
[/tt]

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top