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