Link to home
Start Free TrialLog in
Avatar of Joel_Sisko
Joel_SiskoFlag for United States of America

asked on

SQL JOIN?

How do I take data from one field and join it with data from another field, plus provide some addtional text around that data. So as an example:

TableUserName                 TableUserNumber                  

Joel                                     555-1212
John                                    555-1213
Mary                                    555-1214


The result needs to look like the below while adding the following characters, "=" and "!"

Joel=555-1212!
John=555-1213!
Mary=555-1214!

Joel
SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joel_Sisko

ASKER

gbshaaq,

Option 2 of your response (ISNULL), if I understand you correctly, that if there is a "null" in a field the SQL statement will not return anything. So in the example below:

TableUserName                 TableUserNumber                  

Joel                                     <null>
John                                    555-1213
Mary                                    555-1214

The result would be:

John=555-1213!
Mary=555-1214!





The result would be:

<null>
John=555-1213!
Mary=555-1214!
>>Plus only adds numbers

>er - no it doesn't. in T-SQL, it is the concatenation operator.

oops. Sorry, I thought i was in the mysql group. My bad.