Displaying Data from Multiple Tables
Types of Joins
SQL: 1999 Compliant Joins:
-- Cross joins
-- Natural joins
-- Using clause
-- Full or two sided outer joins
-- Arbitrary join conditions for outer joins
Syntax:
Select tableA. column, tableB.
The last time I took a note, I learned how to query multiple tables. This time I took a note to learn about grouping functions in Oracle.
First, let's take a look at what group functions are:
Group function: acts on a group of data and returns a
Our previous queries are all based on one table. How can we query data from two or more tables? This note is used to learn multi-table queries.
Basic syntax:
Select * | (specific column name, column name 1, column name 2)
From table 1 alias 1,
Create a Data Group
All group functions treat the table as a large information group. However, you sometimes need to divide the table into several smaller groups. You can use the group by clause to complete this task.
Create a Data GROUP: group
Oracle 11g new collection function listparts implements column forwarding
First, the syntax is as follows:Listparts (column | expression,Delimiter) within group (order by column | expression) is a clustering function. Use an example to describe its
SelectRetrieves rows from a database and allows you to select one or more rows or columns from one or more tables. Although the complete syntax of the SELECT statement is complex, its main clauses can be summarized as follows:
Select
When we use SQL statements to perform a query operation, we may find that the queried data results are sorted unordered. To better observe the query results in a data table, developers or users often need to sort the queried data, which requires the
The primary key task is to help MySQL determine the location of a specific data record in the data table as quickly as possible. The primary key must meet the following two conditions:
1. The primary key must be unique. The primary key fields in
Implement select Top N in Oracle:Since Oracle does not support the select top statement, order by and rownum are often used in Oracle.To query the select Top N.To put it simply, the implementation method is as follows:Select column name 1... column
I have been learning about SQL Server recently. I took a test yesterday. It's really not easy. In particular, some complex queries. It makes me dizzy. However, it is also because your knowledge is not solid enough. So today I reviewed the addition,
Add, delete, modify, and delete trigger information
Create or replace trigger hz_test_triggerAfter insert or update or delete on hz_testFor each rowDeclareV_type hz_test_log.l_type % type;BeginIf inserting thenV_type: = 'insert ';Insert into hz_test_
I. operation data (query)
1. Distinct
Syntax: select [distinct] column name [, column name]... from Table Name
Distinct is used to filter duplicate records. If distinct is followed by multiple columns, it filters out duplicates after multiple
Basic PL/SQL statementsAs changed title: column name as Column TitleDistinct Delete copy distinct column nameBetween... And... retrieves the content between two values (including the value of C)In searches for data of any value in the matching
If the MS-SQL combines two or query results into a single result set that contains all rows of all queries in the Union query, a common method
1. Use the Union or union all statement
1. Difference between Union and Union all statements
Union
Mysql index types and advantages and disadvantages
IndexIt is a special file (the index on the InnoDB data table is an integral part of the tablespace) that contains reference pointers to all records in the data table.Note:[1] indexing is not
Limit and offset are usually used together with order. Indexes are helpful for sorting and comparison,
If no index is available, a large number of files are sorted. Therefore, you must add an index to the order by column.
If:
Select * from
OracleDB groups rows-groupby and having. All group functions treat the table as a large information group. However, you sometimes need to divide the table into several smaller groups.
Oracle DB groups rows by group by and having. All group functions
Mysql EXPLAIN display usingfilesort introduction MySQLexplain
The syntax format of bitsCN.com is as follows:
EXPLAIN tbl_name
Or:
Explain select select_options
The EXPLAIN statement can be used as a synonym for DESCRIBE, or used to obtain
Summary of some common syntaxes based on SQL statements bitsCN.com
1. when the value of a field needs to be displayed through other word values (record conversion), the following statement can be used:Case Type when '1' then' normal channel 'when' 2'
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.