in sql:

select * from matches a inner join teams b on a.team1_id=b.teams_id
inner join teams c on a.team2_id=c.team_id

so that a.? is match data, b.? is team1 data and c.? is team2 data

On Dec 10, 10:47 pm, pedro <[EMAIL PROTECTED]> wrote:
> On 10 Dec, 23:35, DenesL <[EMAIL PROTECTED]> wrote:
>
> > > SELECT * FROM teams, matches WHERE matches.team1_id=teams.id AND
> > > matches.team2_id=teams.id
>
> > If I interpret that correctly it means: look for all matches where a
> > team played itself.
> > Unless you are looking for wrongly entered match info it would not be
> > very useful.
>
> After looking carefully to my query I came to that conclusion too.
> _select() returns exactly the SQL statement I initially thought,
> problem is that was incorrect. That is indeed not useful at all.
> So this turns out to be a question about basic SQL,
> How do I  select all matches, from the matches table, and the teams'
> names from the teams table?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to