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.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Combine two libaryies in one report

Author  Topic 

jdeforums
Starting Member

8 Posts

Posted - 2010-03-18 : 10:18:30
Dear all,

i have two different database.And i select one table from one datbase & another table from 2nd database. The examples are shown below

database1/ table 1
Fields are ORDER NO, ORDER TYPE, QTY , VALUE

& database2/table 2
Fields are Order No , Order Type , PO NO,

I want the following output by SQL queries.

Order No , ORDER TYPE, PO NO, QTY , VALUE.

Kindly send the query to download the report

Thanks in advance

Suresh


Suresh.K.P

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2010-03-19 : 01:18:28
Select t1.ORDER_NO,t1.ORDER_TYPE,t2.PO_NO,t1.QTY ,t1.VALUE
from database1.dbo.table1 t1 inner join database2.dbo.table2 t2 on
t1.ORDER_NO=t2.ORDER_NO

Note: considering ORDER_NO is a common field!

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

jdeforums
Starting Member

8 Posts

Posted - 2010-03-19 : 05:16:46
quote:
Originally posted by jdeforums

Dear all,

i have two different database.And i select one table from one datbase & another table from 2nd database. The examples are shown below

database1/ table 1
Fields are ORDER NO, ORDER TYPE, QTY , VALUE

& database2/table 2
Fields are Order No , Order Type , PO NO,

I want the following output by SQL queries.

Order No , ORDER TYPE, PO NO, QTY , VALUE.

Kindly send the query to download the report

Thanks in advance

Suresh


Suresh.K.P



Thanks Senthil for your valuable information. Kindly give your email ID.

Suresh.K.P
Go to Top of Page
   

- Advertisement -