Oracle tree query. If you need it, refer to it. The code is messy. Sorry.
Oracle tree query. If you need it, refer to it. The code is messy. Sorry.
Format:
SELECT column
FROM table_name
Start with column = value
Connect by prior parent primary key = Child foreign key
Select lpad ('', 4 * (level-1) | name, job, id, super from emp
Start with super is null
Connect by prior id = super
Example:
Raw data: select no, q from a_example2
NO NAME
----------------------------------------
001 a01
001 a02
00
Format:
Select column
From table_name
Start with column = Value
Connect by prior parent primary key = Child foreign key
Select lpad ('', 4 * (level-1) | Name, job, ID, super from EMP
Start with super is null
Connect by prior id = super
Example:
Raw data: Select No, Q from a_example2
No name
----------------------------------------
001 A01
001 A02
001 A03
001 a04
001 a05
002 B01
003 c01
003 C02
004 d01
005 e01
005 e02
005 e03
005 e04
005 e05
The result
Format:Select columnFrom table_nameStart with column = ValueConnect by prior parent primary key = Child foreign key
Select lpad ('', 4 * (level-1) | Name, job, ID, super from EMPStart with super is nullConnect by prior id = super
Example:Raw data: Select No, Q from a_example2
No name----------------------------------------001 A01001 A02001 A03001 a04001 a05002 B01003 c01003 C02004 d01005 e01005 e02005 e03005 e04005 e05
The result is as follows:001 A01; A02; A03002 B01003 c01; C02004 d01005 e01
Format:SELECT columnFROM table_nameStart with column = valueConnect by prior parent primary key = Child foreign keySelect lpad ('', 4 * (level-1) | name, job, id, super from empStart with super is nullConnect by prior id = superExample:Raw data: select no, q from a_example2NO NAME----------------------------------------001 a01001 a02001 a03001 a04001 a05002 b01003 c01003 c02004 d01005 e01005 e02005 e03005 e04005 e05The result is as follows:001 a01; a02; a03002 b01003 c01; c02004 d01005 e01;
are similar products on the market, such as Pogoplug, but Pogoplug can only manage its own files and not provide a comprehensive set of Internet services such as chat, website hosting, e-mail, etc. Arkos can provide these services, allowing control of any other resource within a customizable security level. As well as the more famous tails, it is also based on the Linux version of the operating system, but
(code_id);SELECT * from t01 where code_id=1;SELECT * from t01 where code_id= ' 1 ';3. Initialization parameters affect index use: index weightsoptimizer_index_cost_adj=[1~10000]%Alter session set OPTIMIZER_INDEX_COST_ADJ=50;Cost of full-table cost PK index access costs *optimizer_index_cost_adj4. Clustered factor of the index: the number of times the data block of the table is accessed sequentially by accessing the index key value, reflecting the number of times the data block access to the tab
is a simple grouping of the reserved rows of the search results. Generally, the total love and Aggregate functions are used together, such as AVG (), count (), max (), and main.
Although partition by has the grouping function, it also has other functions.It is an oracle analysis function.Use the data of a diligent person to explain:
Sum () over (partition by...) is an analysis function. The result of his execution is different from the ordinary sum... group by.... It calculates the sum of ex
I'll summarize the usage of group by and partition by.Group BY is a simple grouping of the retained rows of the search results, with the general total love and aggregation functions used such as AVG (), COUNT (), Max (), Main (), and so on.Partition by, although it also has a grouping function, but also has other functions.It belongs to the analytic function of Oracle.Borrow a diligent person's data to illustrate:SUM () over (PARTITION by ...) is an analytic function. The effect he performs wit
1. sum over usage
Sum (col1) over (partition by col2 order by col3)
The above function can be understood as: grouping by col2 (partition), sorting by col3 (order), and continuous addition (sum)
Table a has the following content:B C D02 02 102 03 202 04 302 05 402 01 502 06 602 07 702 03 502 02 1202 01 202 01 23
Run: SELECT B, c, d, SUM (d) OVER (partition by B, c ORDER BY d) e FROM
Expected result:
B C E02 01 202 01 702 01 3002 02 102 02 1302 03 202 0
1. sum over usage
Sum (col1) over (partition by col2 order by col3)
The above function can be understood as: grouping by col2 (partition), sorting by col3 (Order), and continuous addition (SUM)
Table A has the following content:B c d02 02 102 03 202 04 302 05 402 01 502 06 602 07 702 03 502 02 1202 01 202 01 23
Run: Select B, c, d, sum (d) over (partition by B, C order by D) E from
Expected result:
B c e02 01 202 01 702 01 3002 02 102 02 1302 03 202 0
Recognize the CSS box model.
The flexible use of CSS selectors.
Instance:
The image text is formed by an HTML file with div and other element layouts.
Create a new CSS file and link to the HTML file.
Style defined in CSS file
Div.img:border,margin,width,float
Div.img Img:width,height
Div.desc:text-align,padding
Div.img:hover:border
Div.clearfloat:clearDOCTYPE HTML>HTMLLang= "en">Head> MetaCharSet= "UTF-8"> title>Omgtitle> Linkrel=
Recently downloaded several American dramas (jailbreak, Lost, right game ...) ), each set has a good long file name. Want to shorten some, but one is too tired, so wrote a script to achieve batch modification:Modified before file name:Modified file name:Code implementation:#Encoding=utf-8ImportOSdefrename (path,newname):#get all file names and directory names under the path directoryFilenames =os.listdir (path) forFileNameinchFilenames:#decide if it's a file or a directory ifOs.path.isdir
Note:
1. "A" in from (select distinct classname from #) A must be available. The record set obtained from (select distinct classname from #) is treated as a new table.
2. When a group by statement is used in an SQL statement, functions such as Count (), sum (), AVG (), max (), and min () are generally used;
However, if you directly use these functions without using the group by statement, all datasets are treated as a group for processing.
Question 2:
The schema of a relational database is kn
it.There are a lot of string processing operations in Lua. After this lesson, try to find the link between the two strings.,And print it out.--
Use examples to learn about Lua (2) --- Lua Basics
1. Use of functionsThe following program demonstrates how to use functions and local variables in Lua.Example e02.lua-- FunctionsFunction Pythagorean (A, B)Local C2 = a ^ 2 + B ^ 2Return SQRT (C2)EndPrint (Pythagorean (3, 4 ))
Running result5
Program
files.Transaction log records:Instead of writing all the log information to a single large file, Exchange uses a series of log files, each of which is exactly 1 MB (or 1,024 KB) in size. If the log file is full, Exchange closes the file and uses an ordinal to rename the file. The first full log ends with the name Enn00000001.log. The nn represents a two-digit number, called the base name or log prefix. Log files for each database are prefixed with a number (for example, E00, E01,
One: Command line Backup and recovery Postgres database①: First switch to Postgres userSu Postgres
②: Backing up a database named host to a temporary file Host.dumpPg_dump-w Host >/tmp/host.dump
③: Import data from backup file infile to database named dbnamePsql dbname
Second: Update a data record in a datasheet①: Log in to the database as a postgres usersudo su postgres-c psql template1
②: Connecting to a database database\c DatabaseName
③: Querying the Data in config tableSelect Configid,key
Python batch Modify file names,
Recently I downloaded several American TV series (jailbreaking, lost, right game...). The file name of each episode is very long .. I want to shorten it, but I am too tired to change it one by one, so I wrote a script to implement batch modification:
File name before modification:
Modified File Name:
Code implementation:
# Encoding = utf-8import osdef rename (path, newname): # Get all file names and directory names under the path directory filenames = OS. list
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.