March 21, 2011 at 7:14 am
select * from A
left outer join (select top 1 consent,rowno_custsinc_cust
from B
where A.rowno = B.rowno_custsinc_cust
order by chkdate,chktime desc)C
on A.rowno_custsinc_cust = A.rowno
Server: Msg 4104, Level 16, State 1, Procedure ##ABC, Line 113
The multi-part identifier "A.rowno" could not be bound.
Please help me to correct this qry...
March 21, 2011 at 7:17 am
does tableA have a column named rowno ?
also on a join condition it does not make much sense for the join condition to reference the same table
March 21, 2011 at 7:18 am
yes.
March 21, 2011 at 7:19 am
on a join condition it does not make much sense for the join condition to reference the same table.
March 21, 2011 at 7:22 am
Try an outer apply rather than a join , judging by your use of top that is what you need.
March 21, 2011 at 7:23 am
my qry like this: the under lined part having the error!!
select * from A
left outer join (select top 1 consent,rowno_custsinc_cust
from B
where A.rowno = B.rowno_custsinc_cust
order by chkdate,chktime desc)C
on C.rowno_custsinc_cust = A.rowno
Server: Msg 4104, Level 16, State 1, Procedure ##ABC, Line 113
The multi-part identifier "A.rowno" could not be bound.
Please help me to correct this qry...
March 21, 2011 at 7:33 am
If i am reading this correctly, you don't really need that where clause at all, as you are joining on the same clause which will restrict it there.
how about post some sample data , table structure, and what you are trying to acheive and it will make it easier for us to help
March 21, 2011 at 7:33 am
I think you just need to remove that whole line with the underlined part. If that doesn't work, please provide DDL, sample data and expected results.
John
March 21, 2011 at 9:50 am
Thanks .It's Done !!!
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply