[英]MySQL query to concatenate data from multiple columns
I need to retrieve data from the database.I have created a table vendor that includes vendor_name, vendor_code, etc,. 我需要从数据库中检索数据。我创建了一个包含vendor_name,vendor_code等的表供应商。
I wish to get the result in the exact way as given here vendo Ali Murtaza have 200 code
where vendo Ali Murtaza is the verdor_name and 200 is vendor_code 我希望得到结果的确切方式如此给出
vendo Ali Murtaza have 200 code
,其中vendo Ali Murtaza是verdor_name,200是vendor_code
Try the following MySQL query on Workbench. 在Workbench上尝试以下MySQL查询。
SELECT CONCAT(vendor_name, " have ", vendor_code, " code.") from vendor_table;
Reference: https://www.w3resource.com/mysql/string-functions/mysql-concat-function.php 参考: https : //www.w3resource.com/mysql/string-functions/mysql-concat-function.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.