MySQL creates a MySQL series of computing fields (5)

Source: Internet
Author: User
Create a calculated field in MySQL-MySQL series (v) 1. The field has the same meaning as the column. The database column is generally called a column, A field generally refers to a calculated Field 2. concatenates A spliced field to form a single Concat () function SELECTConcat (name, (, country,) AStitleFROMcompanyOrderBYname; ASt

Create a calculated field in MySQL-MySQL series (v) 1. The field has the same meaning as the column. The database column is generally called a column, A field generally refers to a calculated Field 2. concatenates a joined field to form a single Concat () function SELECT Concat (name, '(', country ,')') AS title FROM companyOrder BY name; here's AS t

Create a calculated field in MySQL-MySQL series (5)
1. Fields

Fields are similar to column meanings. Database columns are generally called columns, and fields are generally calculated fields.

2. Splice Fields

Join -- connect values together to form a single value

Concat () function

SELECT Concat (name, '(', country, ') AS title FROM companyOrder BY name;
Here, the AS title is the alias, and the title is the calculated field.

3. Execute arithmetic calculation

Allows you to perform addition, subtraction, multiplication, and Division operations.

Select prod_num * prod_price, prod_nameFROM products

4. How to test and calculate

SELECT 3*2, 6 is returned

Select now (), returns the current time

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.