Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditions in left outer join

Status
Not open for further replies.

nsimonov

Programmer
May 21, 2009
4
Hello!
How can add the condition in left outer join in the Database Expert CR2008 or a Data Foundation CR2008 Server?
 
Please explain what tables you are working with, how they are joined (from what to what), and what condition you want to apply. Also identify your database.

-LB
 
Table 1
Name, ID
John, 1
Smith, 2

Table 2
Requirement, GUID
FT1, 44433-44433...
FT2, 33433-gtt54...

Table 3 (many-to-many)
t1_id, t2_Requirement, type
1, FT1, good
1, FT2, bad

I want to next sql query:
select
*
from
Table1
left outer join t3 on t3.t1_id=t1.id
AND t3.type = medium
left outer join t2 on t3.t2_Requirement=t2.Requirement

I can not make the condition in section Where because of the performance and optimality of the query.
As a result, the query I want to get a null value in table 2 and 3. It is obvious that my condition is in reality much more complicated, but I specifically utriruyu not to lead multi-select. Not that I took the StoredProcedure, but did vstrennym designer.

Server - MSSQLServer 2005

Thank you!
 
Your query approach looks correct (except that the punctuation is missing). You should be entering this in database->database expert->your datasource->add command (above the list of tables). If you are doing that and are getting errors, what is the error message? It would probably help if you showed the actual query here.

-LB
 
I must put all query in sql command?
That is, if I refuse to do so from a visual Table links?
 
To do this kind of linking with criteria applied to the link (instead of in a where clause), yes, you must use a command as your datasource.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top