
August 28th, 2001, 05:10 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Originally posted by : HeatherP (vge009@aol.com)------------HeatherP 8/28/01I got this article from brinkster.com click on articlesSQL Basics Part 4 : Update Statement The syntax for the Update statement is:UPDATE TableName SET ColumnName1 = Value1 WHERE ColumnName2 = Value2 There are several things to note about this syntax example. If you do not supply a where clause the update will take effect on all records in the table. ColumnName1 and ColumnName2 can be the same column. Value1 and 2 should be enclosed in '' single quotes for strings and left out for integers.Example:UPDATE CustomerTable SET fname = 'Joe' WHERE lname = 'Doe' This Update statement will set the fname equal to 'Joe' for all records that have the lname equal to 'Doe'. This poses a slight problem, how do you update records without damaging other ones. The answer to this problem is to have a certain column that does not change that you can use to change records from. Usually this field is an id number of some sort.By: Jared Stauffer
|