Two JOINs in SQL
-
My select statement looks like this: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; When I execute ExecuteReader() I' getting an error. With only first join it's OK, with only second join it's OK but with joins there is exception. Is this syntax incorrect for two joins? Jerzy :confused:
-
My select statement looks like this: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; When I execute ExecuteReader() I' getting an error. With only first join it's OK, with only second join it's OK but with joins there is exception. Is this syntax incorrect for two joins? Jerzy :confused:
JerzyPeter wrote: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; string str="select t1.amt,t2.Name,t3.Desc from (t1 left join t2 on t2.ID=t1.ID)left join t3 on t3.ID=t2.ID";;) Best Regards Carlos Antollini. Sonork ID 100.10529 cantollini
-
JerzyPeter wrote: string str="select t1.amt,t2.Name,t3.Desc from t1 left join t2 on t2.ID=t1.ID left join t3 on t3.ID=t2.ID"; string str="select t1.amt,t2.Name,t3.Desc from (t1 left join t2 on t2.ID=t1.ID)left join t3 on t3.ID=t2.ID";;) Best Regards Carlos Antollini. Sonork ID 100.10529 cantollini