Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine data from different fields

Status
Not open for further replies.

aas1611

Programmer
Dec 14, 2001
184
DE
I have the following problem.

Let's say I have a table that looks like this:

Num1 Num2
---- ----
001 002

Both fields are text type. What am I supposed to do to get the result in one column such as this:
EDE001_002

which EDE is just some added string (could be numbers too as text), and Num1 ist connected to Num2 with an underscore (_).

Or can I do this easier with PHP? If yes, how?

Thanks for any help and suggestions!
 
How about:
[tt]
SELECT CONCAT('EDE',num1,'_',num2)
FROM ...
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top