Sunday 15 July 2012

sql - get count(*) from 3rd table using 2nd table foreign key -


Text after "div class =" itemprop = "text">

I get 3 table tbl_RUR_Enclosures using the 2 table counting (*) from the foreign key I'm trying to tbl_RUR_RepurchaseDemands .

Sorry it was a mistake, I've given the wrong SQL query. One has been updated here *

Updated
  Select [Loan number] LoanNum, [Finding ID] as FindingID, [ Finding topic], [Finding story], [TPDAB], T. * From (TBIRRRR_RURNECLOSERS to select COUNT * *), where tbl_RUR_Enclosures [Find ID] = tbl_RUR_RepurchaseDemands [Finding ID]) from DB TBRRRRRRCRR included in the RR form of CDR [tbl_DefectFindingEnclosuresMateriality] T on T [AP_ID] = RR [AP_ID] Choose from [Loan Number] in [Loan Number] = [Loan Number] = [4] 9 261 with TRL_URRARCMFIFENS from SHIF = 'CWABs' and Series =' 2004-K 'and Batch = 1 and [Loan Number] =' 410 9 261 Order]   

throwing error message 4104, level 16, state 1, line 2 multi-part identifier "tbl_RUR_RepurchaseDemands.Finding ID" could not be performed by [loan number] To be bound

Help me

Wonders

Formatting questions such problems To understand: Select the [loan number], [Finding ID] as FindingID, (select COUNT (*) from dbo.tbl_RUR_RepurchaseDemands where [Find ID] = tbl_RUR_Comprehensive. [ Finding ID]) from dbo.tbl_RUR_Enclosures in order from [loan number] in [loan number] from [tbl_RUR_Comprehensive [loan number] where shelf = 'CWABS' and series = '2004-k' and batch = 1] [loan number] order by

You have the select statement Switch to a correlated query correlation, however, where to a subquery clause is not allowed even if it were, subquery column again you are asking for.

I think this is a simple mistake, because is selected that the column is in the table from in the section, if so You can decide it like this:

  Select [loan num], select [Finding ID] as FindingID, (dbo.tbl_RUR_RepurchaseDemands select COUNT (*) where tbl_RUR_RepurchaseDemands Choose from [loan number] in [loan number] from [loan number] from [loan ID] = tbl_RUR_Comprehensive where [shelf = 'CWABS'] and series = '2004-K' And bay F = 1) order [loan number];    

No comments:

Post a Comment