Mailinglisten-Archive |
Tommy schrieb am 29.04.1999: > >Ich habe eine Tabelle (address1) mit Adressen, bei einem Eintrag >möchte ich >jetzt z.B. den Vornamen (vorname char(15)) ändern. >Mit welchem SQL Befehl mache ich das? > > 7.16 UPDATE syntax UPDATE [LOW_PRIORITY] tbl_name SET col_name1=expr1,col_name2=expr2,... [WHERE where_definition] UPDATE updates columns in existing table rows with new values. The WHERE clause, if given, specifies which rows should be updated. Otherwise all rows are updated. If you specify the keyword LOW_PRIORITY, execution of the UPDATE is delayed until no other clients are reading from the table. If you access a tbl_name column in an expression, UPDATE uses the current value of the column. For example, the following statement sets the age column to one more than its current value: mysql> UPDATE persondata SET age=age+1; UPDATE assignments are evaluated from left to right. For example, the following statement doubles the age column, then increments it: mysql> UPDATE persondata SET age=age*2,age=age+1; If you set a column to the value it currently has, MySQL notices this and doesn't update it. UPDATE returns the number of rows that were actually changed. In MySQL 3.22 or later, the C API function mysql_info() returns the number of rows that were matched and updated and the number of warnings that occurred during the UPDATE.
php::bar PHP Wiki - Listenarchive