![Sybase Adaptive Server IQ 12.4.2 Скачать руководство пользователя страница 245](http://html1.mh-extra.com/html/sybase/adaptive-server-iq-12-4-2/adaptive-server-iq-12-4-2_administration-and-performance-manual_1416503245.webp)
CHAPTER 5 Moving Data In and Out of Databases
225
The search condition need not refer to the column being updated. The company
ID for Newton Entertainments is 109. As the ID value is the primary key for
the table, you could be sure of updating the correct row using the following
statement:
UPDATE customer
SET company_name = ’Einstein, Inc.’
WHERE id = 109
The SET clause
The
SET
clause specifies the columns to be updated, and their new values. The
WHERE
clause determines the row or rows to be updated. If you do not have a
WHERE
clause, the specified columns of all rows are updated with the values
given in the
SET
clause.
You can provide any expression of the correct data type in the SET clause.
The WHERE clause
The
WHERE
clause specifies the rows to be updated. For example, the
following statement replaces the One Size Fits All Tee Shirt with an Extra
Large Tee Shirt
UPDATE product
SET size = ’Extra Large’
WHERE name = ’Tee Shirt’
AND size = ’One Size Fits All’
The FROM clause
You can use a
FROM
clause to pull data from one or more tables into the table
you are updating.
Deleting data
To remove data from a database, you can do any of the following:
•
Use the
DELETE
statement to remove from a table all rows that meet the
criteria you specify.
•
Use the
DROP TABLE
statement to remove an entire table, including all
data rows.
•
Use the
TRUNCATE TABLE
statement to delete all rows from a table,
without deleting the table definition.
For syntax of these statements, see the Adaptive Server IQ Reference Manual.
TRUNCATE TABLE
is faster than a
DELETE
statement with no conditions.
Содержание Adaptive Server IQ 12.4.2
Страница 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Страница 16: ...xvi ...
Страница 20: ...Related documents xx ...
Страница 40: ...Compatibility with earlier versions 20 ...
Страница 118: ...Troubleshooting startup shutdown and connections 98 ...
Страница 248: ...Importing data by replication 228 ...
Страница 306: ...Integrity rules in the system tables 286 ...
Страница 334: ...Cursors in transactions 314 ...
Страница 396: ...Users and permissions in the system tables 376 ...
Страница 438: ...Determining your data backup and recovery strategy 418 ...
Страница 484: ...Network performance 464 ...
Страница 500: ...System utilities to monitor CPU use 480 ...
Страница 514: ...Characteristics of Open Client and jConnect connections 494 ...
Страница 536: ...Index 516 ...