-
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','');
-
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%'
-
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".
-
update [table name] set [field name] = [value] where [condition].
-
update table set the field you want to update = the value you want to update where you want to update the condition.
-
You write like this complicated, change to.
update
set dtzc =
from select dtzc b1
zkzh b2
from bwhere zkzh =
-
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;
-
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.
-
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.
-
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,
-
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
-
like ''60__c%''Add the percent sign and try again.
-
update table set field=replace(field,'Haidian District','Chaoyang District')
where 。。Such?
-
Check it out first, and then use the string replace method to update the updated string into the database.
-
update table name set a=replace( a,'Haidian', 'Rising sun') where a like 'Haidian';
SQL stands for Structured Query Language.
structured query language), which is a special-purpose programming language. >>>More
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
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
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
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