Modification and backup, batch processing
Sometimes we need to modify and delete database tables and databases, which can be implemented as follows:
1. Add a column:For example, in the mytable table in the previous example, adding a column to indicate whether the table is single or not:Mysql> alter table mytable add column single char (1 );
2. Modify recordsModify the single record of abccs to "y ":Mysql> update mytable set single = 'y' where name = 'abccs ';
Now let's see what happened:Mysql> s
column to indicate whether the table is single or not:
MySQL> alter table mytable add column single char(1);
2. Modify recordsModify the single record of abccs to "y ":
MySQL> update mytable set single='y' where name='abccs';
Now let's see what happened:
MySQL> select * from mytable;
+----------+------+------------+-----------+--------+
| name | sex | birth | birthaddr | single |
+----------+------+------------+-----------+--------+
| abccs|f | 1977-07-0
Sys_connect_by_path Function
Since Oracle 9i, you can use the sys_connect_by_path function to display the content from the parent node to the current row in the form of a "path" or a list of hierarchical elements. For example:Column path format A50Select level, sys_connect_by_path (child, "/") pathFrom hierStart with parent is nullConnect by prior child = parent;
Level path----------------------------------------------------1/Asia2/Asia/China3/Asia/China/Beijing2/Asia/Japan3/Asia/Japan/Osaka3/As
When Union all is used for join, if a column in a set is of the nvarchar2 or nvarchar type, but this column is not included in Set B, ''is used to replace the reported Character Set mismatch.There are two solutions:
Problematic SQL:
Select 'China', 'China', cast ('China' as nvarchar2 (10) TFrom dualUnion allSelect 'USA ', 'USA ',''From dual;
As shown above, the T type is nvarchar2 and the length is 10. I
Awk string functions (2)
The substr function returns a substring starting from the specified position of the string. If the length of the substring is specified, the corresponding part of the string is returned. If the specified length exceeds the actual range of the string, the actual content is returned.FormatSubstr (string, starting position)
Substr (string, starting position, substring length)
Example$ Awk '{print substr ("Santa Claus", 7,6)}' filename
Claus
Note: In the string "Santa Claus"
"Scoring program for volleyball game"First, the planEstimate how long the task will take 7 days.Second, the development1. Demand AnalysisAs a volleyball enthusiast, I want to know the score of the volleyball match so as to better master the score of the game.2. Create a design documentQuery for each game bureau and total score3. Design ReviewThe project is relatively simple. No design Review4. Code specification. Using the VS2010 Programming specification5. Concrete Design (activity Chart)6, the
) Automation Institute of CAS; http://www.ia.cas.cn/(11) Li Zizing researcher of Automation Institute of CAS; http://www.cbsr.ia.ac.cn/users/szli/(12) Shanshi Researcher, Institute of Computational Sciences, CAS; http://www.jdl.ac.cn/user/sgshan/(13) Human face recognition homepage; http://www.face-rec.org/(14) University of California, Berkeley CV Group; http://www.eecs.berkeley.edu/Research/Projects/CS/vision/(15) University of Southern California CV Laboratory; http://iris.usc.edu/USC-Compute
MySQL MySQL primer learning (vi)
--Modification and backup, batch processing
Sometimes we have to modify and delete database tables and databases, which can be implemented in the following ways:
1. Add one column:
Add a column in the MyTable table in the previous example to indicate whether single singles:
Mysql> ALTER TABLE mytable add column single char (1);
2, modify the record
Modify the Abccs single record to "Y":
mysql> Update mytable set single= ' y ' where name= ' Abccs ';
Now let's
to read
Recommendation: Disable anonymous access to the/MSADC directory
WORKAROUND: Delete or remove showcode.asp in your web directory
Please go to the following address to search for patches
Internet Information Server:
ftp://ftp.microsoft.com/bussys/iis/iis-public/fixes/usa/Viewcode-fix/
Site Server:
ftp://ftp.microsoft.com/bussys/sitesrv/sitesrv-public/fixes/usa/siteserver3/hotfixes-postsp2/Viewcode-f
By applying CSS, you can consider an XML document to add display information. Apply CSS to display your XML? It is possible to apply CSS to visualize XML documents. The following example shows how to apply a CSS style sheet to format an XML document: this is an XML file:
By applying CSS, you can consider an XML document to add display information.
Apply CSS to display your XML?
It is possible to apply CSS to visualize XML documents.
The following example shows how to apply a CSS style sheet to v
ProductPlace
Price
Apple
China
$1.1
Apple
Japan
$2.1
Apple
USA
$2.5
Orange
China
$0.8
Banana
China
$3.1
Peach
USA
$3.0
If we want to know how many fruits are available in each country, we can use the following SQL statement: SELECT COUNT (*) AS fruit type, ProductPlace AS country of origin
FROM T_TEST_FRUITINFO
The SQL statement group by ProductPlace uses the Group By + grouping field, so this SQL st
Enable mod_rewriteEnable mod_rewrite moduleTo use the URL rewriting function, you must install the mod_rewrite module. Use the phpinfo () function to find the Apache Modules section. You can see the current apache loading module.If mod_rewrite is not enabled, You need to configure the mod_rewrite.so path:LoadModule rewrite_module modules/mod_rewrite.soApache2 has built-in mod_rewirte. In the VirtualHost configuration file, open the engine: RewriteEngine on.Then you can use the rewrite syntax.The
)
Sqlldr userid = 'sys/test as sysdba 'control = 'C: \ load. CTL 'log = 'C: \ log. Log'
-- How to load delimitersLoad dataInfile 'C: \ 1.txt'Into Table DeptFields terminated by ', 'optionally enclosed '"'(Deptno, dname char (1000), Loc)
---- The data is as follows:10, sales, "Virginia, USA"20, accounting, "Va," "Virginia """30, consulting, Virginia40, finance, Virginia
---- The result is as follows:10, sales, Virginia, USA20, accounting, VA, "Virginia
Take a look at the following
Code :
Copy code The Code is as follows: sbyte SBA, SBB, SBV;
SBA = 1;
SBB = 2;
SBV = SBA + SBB;
Byte Ba, BB, BV;BA = 1;BB = 2;Bv = BA + BB;
Short SA, Sb, SV;Sa = 1;SB = 2;SV = SA + Sb;
Ushort USA, USB, usv;USA = 1;USB = 2;Usv = USA + USB;
Do you think this code can be correctly executed? What will happen? The result is: a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.