[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Join on a open rowset

Posted on 2008-10-03
3
Medium Priority
?
346 Views
Last Modified: 2012-05-05
hi there,
I have a query that need to be join with another query that comes from another database. I have an open rowset and it works how can i achieve this?
here the open rowset:
SELECT a.*
FROM OPENROWSET('SQLOLEDB','GIS';'gisinq';'gisinq',
   'SELECT FOLIO, [NAME] FROM gis.PARCELS_HOMEOWNERS_ASSOCIATIONS ORDER BY [NAME]') AS a

and need to be link with this query:
SELECT DISTINCT uvw_PV_LOOKUP.NUMBER_KEY, uvw_PV_LOOKUP.ENTERED_DATE, tblAddressLookup.NAME_LINE_1,
       tblAddressLookup.NAME_LINE_2, tblAddressLookup.MAILING_ADDRESS, tblAddressLookup.MAILING_ADDRESS_2,
      tblAddressLookup.SITUS_ADDRESS
FROM uvw_PV_LOOKUP left outer join tblAddressLookup
            on uvw_PV_LOOKUP.folio_NUMBER = tblAddressLookup.FOLIO_NUMBER
            left outer join --Here
where
      uvw_PV_LOOKUP.DATA_STATUS ='APPLIED'AND
      uvw_PV_LOOKUP.TYPE_DEPT = 'BUILDING' AND

How can i do this?
0
Comment
Question by:jsctechy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 22633360
this should do:
SELECT DISTINCT uvw_PV_LOOKUP.NUMBER_KEY, uvw_PV_LOOKUP.ENTERED_DATE, tblAddressLookup.NAME_LINE_1,
       tblAddressLookup.NAME_LINE_2, tblAddressLookup.MAILING_ADDRESS, tblAddressLookup.MAILING_ADDRESS_2,
      tblAddressLookup.SITUS_ADDRESS, a.NAME
FROM uvw_PV_LOOKUP left outer join tblAddressLookup
            on uvw_PV_LOOKUP.folio_NUMBER = tblAddressLookup.FOLIO_NUMBER
            left outer join OPENROWSET('SQLOLEDB','GIS';'gisinq';'gisinq',
   'SELECT FOLIO, [NAME] FROM gis.PARCELS_HOMEOWNERS_ASSOCIATIONS ORDER BY [NAME]') AS a
  ON a.FOLIO = uvw_PV_LOOKUP.folio_NUMBER 
where
      uvw_PV_LOOKUP.DATA_STATUS ='APPLIED'AND
      uvw_PV_LOOKUP.TYPE_DEPT = 'BUILDING' AND

Open in new window

0
 
LVL 1

Author Comment

by:jsctechy
ID: 22633400
did you know i have that? i was missing the part ON a.FOLIO = uvw_PV_LOOKUP.folio_NUMBER  and it was giving me an error.

I guess i overlooked the query. too early in the morning i guess!
Thanks,
jsctechy
0
 
LVL 1

Author Closing Comment

by:jsctechy
ID: 31502729
Thanks for your help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question