2013-02-25 51 views
1

我有這樣MySQL的CONCAT字符串結果

Name Country State 
John US  California 

我想做一個select語句用CONCAT一個表,所以我得到這樣的

http:// getmehelp/US/John.txt 
+0

嘗試CONCAT_WS() – sanj 2013-02-25 12:04:53

回答

2
SELECT CONCAT ('http://getmehelp/', country , '/', name , '.txt') AS link; 
0
select concat('http://getmehelp/', country, '/', name, '.txt') 
from your_table 
2

查詢您正在尋找應該是這一個:

SELECT concat('http://getmehelp/',Country,'/',Name,'.txt') 
FROM table;