Problem selecting data. (Inner join)
- a table with match/clanwar data in it (time,date,opponent,etc.)
- a table with groups in it. (name and description of the group)
- a table that relates the groups table to the wars table.
Hard for me to explain my problem so here's an image to make it more clear (hopefully): problem (jpg)
On the image you can see that for war id '6' there are 2 groups. (this means that this clanwar is only relevant for members in those groups). With the id's from the war_groups table i can get the names related to those id's from the groups table. Those names should be displayed along with the other data from the war with id 6.
Here's the query i currently use to select the war data:
I left out some data/fields to keep the query simple.
gametypes.name AS gametype,
matchtypes.name AS matchtype
INNER JOIN gametypes ON gametypes.id = wars.gametype
INNER JOIN matchtypes ON matchtypes.id = wars.matchtype
Now my problem:
How can i select (in the same query) all group names related to each war. Is it possible to do this in 1 query?
I want the output to be like how you see it on the image.
So something like this:
date: 3 june 2006
for groups: UT 2004 members, Call of Duty members
planned by: stefan
Hope you understand my problem and you can help me.
thanks in advance.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)