MySQL system functions and federated queries

Source: Internet
Author: User
Tags mathematical functions

A function is a keyword in SQL that is used to manipulate the data in a field. A function is a command, usually used in conjunction with a field name or an expression, to process the input data and produce a result

Common functions

Control functions

String functions

Mathematical functions

Date-time functions

Summary functions

Case

SUBSTRING

Abs

DATEDIFF

Avg

IF

Left

Floor

Date_add

COUNT

Nullif

LENGTH

RAND

Str_to_date

MAX

Ifnull

LOWER

Date_format

MIN

REPLACE

SUM

Concat

1. Left connection

The left table is the main query data

2. Right connection

The right-hand table is the main query data

3. Internal connection

A typical connection operation, using a comparison operator like = or <>. Includes both equal and natural connections.

An inner join uses a comparison operator to match rows in two tables based on the values of the columns that are common to each table.

Left connection

The result set for the left join includes all rows from the left table specified in the IEFT clause, not just the rows that match the joined columns. If a row in the left table does not have a matching row in the right table, all select list columns in the right table in the associated result set row are null values.

Left JOIN

Select A.* , B.* from A  leftjoinon= B.colname

Right connection

The right connection is the reverse connection of the left connection. All rows of the right table will be returned. If a row in the right table does not have a matching row in the left table, a null value will be returned for left table.

Right JOIN

Grammar Select A.* , B.*from  A  right  join on = B.colname

Internal connection

Displaying the data associated with two tables is equivalent to asking for the intersection of two sets.

INNER JOIN

Grammar Select A.* , B.* from A  innerjoinon= B.colname

Union [All]

The Union operator can combine the results of two or more SELECT statements, with no duplicates. In other words, if the output of a row exists in a query result, then the records of the same row of the other query results will no longer be output. When using the union operator, you must select the same number of fields, the same number of field expressions, the same data type, the same order (but not the same length) in each SELECT statement

If you need not to remove duplicates, add the ALL keyword

MySQL system functions and federated queries

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.