Deleting Data - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

The SET clause
The WHERE clause
The FROM clause

Deleting data

CHAPTER 5
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
clause specifies the columns to be updated, and their new values. The
SET
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
WHERE
given in the
clause.
SET
You can provide any expression of the correct data type in the SET clause.
The
clause specifies the rows to be updated. For example, the
WHERE
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'
You can use a
clause to pull data from one or more tables into the table
FROM
you are updating.
To remove data from a database, you can do any of the following:
Use the
statement to remove from a table all rows that meet the
DELETE
criteria you specify.
Use the
DROP TABLE
data rows.
Use the
TRUNCATE TABLE
without deleting the table definition.
For syntax of these statements, see the Adaptive Server IQ Reference Manual.
is faster than a
TRUNCATE TABLE
Moving Data In and Out of Databases
statement to remove an entire table, including all
statement to delete all rows from a table,
statement with no conditions.
DELETE
225

Advertisement

Table of Contents
loading

Table of Contents