SQL statement modification, there is known Kasumi

Updated on technology 2024-04-05
4 answers
  1. Anonymous users2024-02-07

    update [tablename] set ftimeopen='20080608123726' where substr(ftimeopen,0,8) like '20080608'

    If it is a sqlserver, you can find the function corresponding to Oracle Substr to replace it.

  2. Anonymous users2024-02-06

    How SQL Server is written Other databases modify the corresponding functions.

    ftimeopen is character-based data.

    update table name.

    set ftimeopen=replace(ftimeopen,'20080508','20080608')

    where ftimeopen like '%20080508%'

    ftimeopen is a date-based data.

    update table name.

    set ftimeopen=dateadd(mm,1,ftimeopen)

    where year(ftimeopen)='2008' and month(ftimeopen)='5' and day(ftimeopen)='8'

  3. Anonymous users2024-02-05

    update ftimeopen set field'20080508'where field like'20080608'%

    I guess so.

  4. Anonymous users2024-02-04

    In SQL statement, you can use the update statement to modify the data in a table.

    How to write the SQL modification statement: [update table name, set column name, new value, where column name, a certain value].

    The update statement specifies not only the rows to change, but also the expression to be used as the new value for a particular column in those rows.

    You can use the update statement to change a single row, a group of rows, or all rows in a table. Unlike other data modification statements (insert, merge, and delete), the update statement can also modify rows in multiple tables at the same time.

    In all cases, the execution of the update statement is atomic; Either modify all the lines correctly or none at all. For example, if the data type of one of the currently modified values is incorrect, or if the new value causes a violation of the check constraint, the update will fail and the entire operation will be rolled back.

    Precautions for using the update statement

    1. If you use the update statement, if you omit the "where condition", all records in the data table will be updated.

    2. When assigning values, pay attention to the type of field. If it is text or note, the field value should be quoted around both sides, and if it is a date and time type, the field value should be marked on both sides (quotation marks are also acceptable); If it is a Boolean type, the value of the field is true or false. If it is an autonumbering type, do not assign a value to this field.

Related questions
5 answers2024-04-05

With a view or an index.

create index >>>More

5 answers2024-04-05

The foreground interacts with the data stored internally. >>>More

15 answers2024-04-05

1.It's interesting to understand, but the reality should be: if there are more than two fields after order by, then all the records in the result set are sorted by the previous field, and the same part of the previous field is sorted by the next field. For example: >>>More

4 answers2024-04-05

Generally refers to indexing. You don't have to.

7 answers2024-04-05

You're not constructing the scope of in the right way. You're processing in this way as a string. And in should be followed by a range. >>>More