Đang chuẩn bị liên kết để tải về tài liệu:
Mysql your visual blueprint for creating open source databases- P7

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Mysql your visual blueprint for creating open source databases- P7:The show tables command displays a list of tables available in the currently selected database. You can use this command when you are unsure of the exact name of a table within the database. | UPDATE DATA IN TABLES PKtSïfï L 5 If you are working with a table that has a timestamp column this column is automatically updated with the current date and time in each row modified by any UPDATE query. If you want to update a row and preserve the current value of the timestamp column you must explicitly set the column to its original value. For example if you were to add a second address to the address table and perform a similar update you may want to avoid updating the timestamp in the updatetime column. The following query accomplishes this Example UPDATE address SET address2 address city2 city state2 state updatetime updatetime While setting a column to its own value normally has no effect in a timestamp column this prevents the MySQL server from automatically updating the field. You can also set the timestamp column explicitly to a different value. For example the following UPDATE query sets all rows to a specified updatetime value Example UPDATE address SET address2 address city2 city state2 state updatetime 20030101120000 L-0 Type UPDATE mail SET address2 address and press Enter. You are prompted for the next line. Ln Type SELECT name address address2 FROM mail and press Enter. Type city2 city state2 state postal2 postal and press Enter. Th is completes the UPDATE query. All of the rows of the table are updated. The values of the columns you specified are displayed for all rows. Verify that the address values were copied. 107 MySQL INCREMENT A COLUMN VALUE Often you will find it useful to update a column s value based on its existing value. The simplest example of this is to increment a numeric column s value. This is easy to do in an UPDATE query by referring to the column s current value. For example suppose you created a table to store exam statistics for students. The following CREATE TABLE query creates this simple table CREATE TABLE exams name VARCHAR 80 numtests INT totalscore INT avgscore TINYINT This creates a table called exams with four columns