Steve,

What you really want is two separate instances of the teams table, 
one representing team 1, and one for team 2. Any time you do 
something that tricky in SQL, you are more likely to get what you want 
in R:Tango by resorting to the Direct DBMS action:

I would change the select action to a direct dbms action, with a query 
like this:

SELECT h1.T_Name as `HomeTeamName`,
  a2.T_Name as `AwayTeamName`, 
  h1.t_id as `HomeTeamID`, 
  a2.t_id as `AwayTeamID`, 
  m3.m_id as `MatchID` 
  FROM Teams h1, Teams a2, Matches m3
 WHERE (h1.T_ID = m3.m_team1) 
  AND (a2.T_ID = m3.m_Team2)

Alternatively, create a view like the query above, and then use a 
Witango search action with the view.

Bill

On Mon, 9 Dec 2002 17:42:19 -0600, Fogelson, Steve wrote:

>I use R:Tango 2000 on a Windows 2K server.
>
>I have 2 tables as follows:
>
>Table - Teams
>Fields - T_ID, T_Name
>
>Table - Matches
>Fields - M_ID, M_Team1, M_Team2
>
>M_Team1 & M_Team2 relate to T_ID in Teams. I want to do a search 
action of
>records in table Matches "joining" T_Name.
>
>In the search action, I list the following under "join"
>
>Match.Team1=Teams.T_ID
>Match.Team2=Teams.T_ID
>
>What do I list under "select" to get both names?
>
>Hope this makes sense.





________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to