简体   繁体   中英

mysql: show two separate fields become one field

dear all..i have a table it looks like:

Name        version
DDX           01
DTX           05

could i combine two separate fields become one field? and it will show like:

Model
DDX01
DTX05

thanks before..

You could use the following query (using CONCAT ) to insert the Model in a new table or a new column

SELECT
  CONCAT(Name,version) AS Model
FROM
  table

Use MySQL CONCAT keyword. As for your question, it will be like:-

SELECT CONCAT(Name, version) AS Model FROM table

(as mentioned by others already)

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM