Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tradingpassion
Starting Member
24 Posts |
Posted - 2005-05-26 : 00:13:34
|
| I have two databases ABCXYZI have user_id field on one of them(ABC database) with the table let's say abc_customerI want to get the users names instead of their IDS so I go to the other database(XYZ) and it has a table called XYZ_customer and has two fields USER_ID and USER_NAMEI want to join these two so that I can get the name instead of ID on the first database...and here is what I am doingSELECT USER_NAMEFROM abc..abc_Customer AS SUINNER JOIN xyz_customer as CON C.USER_ID = SU.user_idI ma getting some answers but those are not right???I will appreciate if you can advice me what am I doing wrong |
|
|
raclede
Posting Yak Master
180 Posts |
Posted - 2005-05-26 : 00:38:25
|
| SELECT xyz..xyz_customer.username FROM xyz..xyz_customer RIGHT JOIN abc..abc_customer ON xyz..xyz_customer.userid = abc..abc_customer.useridraclede |
 |
|
|
raclede
Posting Yak Master
180 Posts |
Posted - 2005-05-26 : 00:41:31
|
quote: Originally posted by tradingpassion I have two databases ABC --- assumingly 1st databaseXYZ --- assumingly 2st databaseI want to get the users names instead of their IDS so I go to the other database(XYZ) and it has a table called XYZ_customer and has two fields USER_ID and USER_NAMEI want to join these two so that I can get the name instead of ID on the first database...and here is what I am doingSELECT USER_NAMEFROM abc..abc_Customer AS SUINNER JOIN xyz_customer as CON C.USER_ID = SU.user_idI ma getting some answers but those are not right???I will appreciate if you can advice me what am I doing wrong
very confusing..raclede |
 |
|
|
|
|
|