When I read the Mysql manual again today, I see a function concatenation field that is ignored at ordinary times. In fact, it is simple to use mysql functions to process strings. The calculated field is usually used, but the spliced field is ignored. Mark it here.
A field (filed) basically has the same meaning as a column and is often used interchangeably. However, a database column is generally a column, and a term field is usually connected to a calculated field.
Table Structure:
- 'Sdb _ bookstore_book','CREATE TABLE'Sdb _ bookstore_book '(
- 'Bid'Int(11)NOT NULLAUTO_INCREMENT,
- 'Code'Varchar(100)DEFAULT NULL,
- 'Bname'Varchar(100)DEFAULT NULL,
- 'Author'Varchar(100)DEFAULT NULL,
- 'Publish'Varchar(100)DEFAULT NULL,
- 'Pubtime'Varchar(100)DEFAULT NULL,
- 'Price'Varchar(20)DEFAULT NULL,
- 'Language'Varchar(50)DEFAULT NULL,
- 'Intime'Date DEFAULT NULL,
- 'Quantity'Int(5)DEFAULT NULL,
- 'Content'Varchar(500)DEFAULT NULL,
- 'City' enum ('Beijing','Shanghai Hongqiao','Shanghai Puyuan')DEFAULT 'Shanghai Puyuan',
- 'Tag'Varchar(500)DEFAULT NULL,
- 'State' enum ('Shelving','Not on shelf')DEFAULT 'Shelving',
- 'Lastname'Varchar(100)DEFAULT NULL,
- 'Lasttime'Date DEFAULT NULL,
- 'Lastname'Varchar(100)DEFAULT NULL,
- 'Lasttime'Date DEFAULT NULL,
- 'Remark'Varchar(100)DEFAULT NULL,
- 'Img'Varchar(200)DEFAULT NULL,
- 'Standrbtime'Date DEFAULT NULL,
- 'Amount'Int(5)DEFAULT '0',
- 'Isbn'Varchar(13)DEFAULT NULL,
- PRIMARY KEY('Bid ')
- ) ENGINE = InnoDB AUTO_INCREMENT = 956DEFAULTCHARSET = utf8'
The table contains certain data.
Now I want to extract the author of the field name from the database and then use the name (author) as a Field Layout. Then I can extract the name from the database and splice it with languages, however, mysql functions can be directly spliced here.
- SELECT CONCAT(bname,'(',author,')') AS new_filed FROM sdb_bookstore_book
Returned data 'Wolf (Liu yongsheng )'
This is the case. The processing in mysql is still relatively fast.
I won't bother here with arithmetic calculation.