Joel_Sisko
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The result would be:
<null>
John=555-1213!
Mary=555-1214!
<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.
>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.
ASKER
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!