Update a value in a database field!!!

Updated on technology 2024-04-30
15 answers
  1. Anonymous users2024-02-08

    This can be done in oracle with the following statement:

    select replace(replace(bookname,'1001',''),'1002','') from test ;

    Use the replace() function.

    replace('string','s1','s2'string The character or variable you want to be replaced.

    s1 The string that was replaced.

    s2 The string to replace.

    Idea: Replaced with an empty string'1001','1002'

    If you want to really delete it, you can directly use update to change it:

    update test set bookname=replace(replace(bookname,'1001',''),'1002','');

  2. Anonymous users2024-02-07

    Delete rows with values of 1001 or 1002.

    delete from test

    where bookename like '%1001%' or bokname like '%1002%'

    Delete rows that have values of both 1001 and 1002.

    delete from test

    where bookname like'%1001%1002%' or bookname like'%1002%1001%'

  3. Anonymous users2024-02-06

    You can use the update method directly in SQL.

    sql:update table tablename set name ='zhangsan';

    Explanation: The above SQL means that the value of the name field in the tablename table is updated to "Zhang San".

  4. Anonymous users2024-02-05

    update [table name] set [field name] = [value] where [condition].

  5. Anonymous users2024-02-04

    update table set the field you want to update = the value you want to update where you want to update the condition.

  6. Anonymous users2024-02-03

    You write like this complicated, change to.

    update

    set dtzc =

    from select dtzc b1

    zkzh b2

    from bwhere zkzh =

  7. Anonymous users2024-02-02

    Use the update statement. The syntax is: update table name set column = value[, colunm = value....where condition];

    The part in indicates that there may or may not be there.

    For example: update students set stu name ="zhangsan", stu_gender = "m" where stu_id = 5;

  8. Anonymous users2024-02-01

    Format: update table name set field name = field name + 1 [ where statement].

    For example, if there is a student table in the database, you want to add 1 to the score of a student with an ID of 1.

    update student set score=score+1 where id = 1

    If you don't add where the system won't know which record you want to update, the score will increase by 1 in all of the tables, unless, of course, that's what you intended.

  9. Anonymous users2024-01-31

    Format: update table name.

    Baidu set Field name = field name + 1 [ where statement zhi] For example, if there is a student table in the database, if you want to add 1 to the student's score with ID 1, then update student set score=score+1 where id = 1 If you don't add where to the right, the system won't know which record you want to update, resulting in the score in all the tables increasing by 1. Unless, of course, that's what you intended.

    Remember to adopt it.

  10. Anonymous users2024-01-30

    1. Create table test replace(id number, value varchar2(20));

    2. Insert test data.

    insert into test_replace values(1,'1yy');

    insert into test_replace values(2,'1yy');

    insert into test_replace values(3,'2xx');

    insert into test_replace values(4,'3ss');

    insert into test_replace values(5,'4bbb');

    3. Query the number of all records in the table, select t*,rowid from test replace t,4、Write sql,implement the replacement function,select t.*,replace(value,'1yy','1y') value2 from test_replace t,

  11. Anonymous users2024-01-29

    If your database is access, you can't do it.

    SQL Server.

    update a set x = replace(x,'a','b');

    Hypothesis: The original content of x is abababab

    After execution, it becomes bbbbbbbb

  12. Anonymous users2024-01-28

    like ''60__c%''Add the percent sign and try again.

  13. Anonymous users2024-01-27

    update table set field=replace(field,'Haidian District','Chaoyang District')

    where 。。Such?

  14. Anonymous users2024-01-26

    Check it out first, and then use the string replace method to update the updated string into the database.

  15. Anonymous users2024-01-25

    update table name set a=replace( a,'Haidian', 'Rising sun') where a like 'Haidian';

Related questions
12 answers2024-04-30

SQL stands for Structured Query Language.

structured query language), which is a special-purpose programming language. >>>More

5 answers2024-04-30

Causes: There are several main reasons for the error:

This error occurs when your program tries to update the database or something similar. This is because. >>>More

6 answers2024-04-30

The structure of the storage is the main basis for classifying the types of copy databases. In today's Internet, databases are usually divided into two categories, namely relational and non-relational databases. >>>More

9 answers2024-04-30

Create a database.

Select the Program Management SQL Server 2008 SQL Server Management Studio command in the Start menu to open the SQL Server Management Studio window and establish a connection using Windows or SQL Server authentication. >>>More

10 answers2024-04-30

The database is generally composed of many tables, for example, the school builds a database, which can build a student table (including the student's name, age, student number, class, date of birth), a teacher table (including the teacher's name, age, teaching class, teaching category), a report sheet (including the student's student number, and the grades of each subject), etc. These are the ways in which the files are stored in the database, and try to make sure that the items in a table are closely related and have the same attributes, if this condition cannot be met, a table must be built (the redundancy of the built table has 4 levels). In order to meet the user's query needs, we also need to make a number of views, for example, you can make a view of his items have the name of the student, age, grades of each subject, and the teacher of each subject, etc., we can also export new items according to the existing items, for the purpose of simplicity, for example, the view can add an average grade, we add different permissions and roles to each view, and provide it to different people to query to protect the security of the database. >>>More