SELECT TOP 1000 [FNAME]
,[LNAME]
,[ID]
FROM [TESTDB].[dbo].[USERS]
FNAME LNAME ID
Arvind Reddy 1
Ravi Reddy 2
Tom Shawn 3
SELECT TOP 1000 [ORDER_ID]
,[USER_ID]
,[ORDER_INFO]
,[ORDER_AMT]
FROM [TESTDB2].[dbo].[USER_ORDERS]
ORDER_ID USER_ID ORDER_INFO ORDER_AMT
9001 1 BOOKS 10
9002 2 SHOES 20
SELECT A.[ORDER_ID]
,A.[USER_ID]
,A.[ORDER_INFO]
,A.[ORDER_AMT],B.ID,A.USER_ID
FROM [TESTDB2].[dbo].[USER_ORDERS] A ,[TESTDB].[dbo].[USERS] B where A.USER_ID=B.ID ;
ORDER_ID USER_ID ORDER_INFO ORDER_AMT ID USER_ID
9001 1 BOOKS 10 1 1
9002 2 SHOES 20 2 2
Address Phone City User_id ID
1234 test 2145524585 Hyd 1 1
52426 test 5246853652 Hyd 2 2
582 test st 5286943568 Bglr 3 3
768 TEST RD 56799976887 OMAHA 4 4
768 TEST RD 56799976887 OMAHA 5 5
No comments:
Post a Comment