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

how to edit a field in a table - newbie 2

Status
Not open for further replies.

leegold

Technical User
Mar 19, 2002
39
US
Here's a newbie question, I did "google it" but couldn't sift out the answer.

I got a table with thousand records. There's one record that has one field whose value I want to edit. So basically I want to edit one field in my DB. I see the update command.... and each record has a unique PK of course so I have what I need to "zero-in" on the record - but not sure how. Thanks

 
Try something like:
[tt]
UPDATE tablename
SET fieldname='asdf'
WHERE keyfieldname='1234'[/tt]



-----
ALTER world DROP injustice, ADD peace;
 
Code:
UPDATE mytable set somefield='a_nice_value' where somefield='some_annoying_value';
additionally, use AND to add another field as a point of reference to ensure you get the ringht one:
Code:
UPDATE mytable set somefield='a_nice_value' where somefield='some_annoying_value' AND some_other_field='another_unique_value';

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top