MYSQL HELP! :(

This is a discussion on MYSQL HELP! :( within the MySQL Database forums, part of the Database Forums category; Hi people. This is my first thread, i hope you can help me. I'm a newbie and my english ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-25-2008
tranky
 
Posts: n/a
Default MYSQL HELP! :(

Hi people.
This is my first thread, i hope you can help me.
I'm a newbie and my english is so bad, but, i hope you can understand
me. this is my question:

I've a table TURN with this field
IDTURN (int)
SEASON (string)
SORT (string)

another table GROUP
IDGROUP (int)
IDTURN (int)

a table MATCH
IDMATCH (int)
IDGROUP (int)
IDHOMETEAM (int)
GOLHOMETEAM (int)

and i've another table TRAINER_TEAM
IDTRAINER (int)
IDTEAM (int)
IDTURN_FROM (int)
IDTURN_TO (int)

in this table i've an ID for the trainer, the id of team and the
duration of the experience of this trainer with this team. The duration
is set up by an IDTURN_FROM and an IDTURN_TO.

i'll want to SELECT SUM OF GOLHOMETEAM FROM MATCH TABLE WHERE
TRAINER_TEAM.IDTEAM = MATCH.IDHOMETEAM AND MATCH.IDGROUP.IDTURN.SORT >=
TRAINER_TEAM.IDTURN_FROM.SORT AND MATCH.IDGROUP.IDTURN.SORT <=
TRAINER_TEAM.IDTURN_TO.SORT
AND TRAINER_TEAM.IDTRAINER=5

i hope is understandable.
please help, is important!!

thank u!
Reply With Quote
  #2 (permalink)  
Old 05-25-2008
Paul Lautman
 
Posts: n/a
Default Re: MYSQL HELP! :(

tranky wrote:
> Hi people.
> This is my first thread, i hope you can help me.
> I'm a newbie and my english is so bad, but, i hope you can understand
> me. this is my question:
>
> I've a table TURN with this field
> IDTURN (int)
> SEASON (string)
> SORT (string)
>
> another table GROUP
> IDGROUP (int)
> IDTURN (int)
>
> a table MATCH
> IDMATCH (int)
> IDGROUP (int)
> IDHOMETEAM (int)
> GOLHOMETEAM (int)
>
> and i've another table TRAINER_TEAM
> IDTRAINER (int)
> IDTEAM (int)
> IDTURN_FROM (int)
> IDTURN_TO (int)
>
> in this table i've an ID for the trainer, the id of team and the
> duration of the experience of this trainer with this team. The
> duration is set up by an IDTURN_FROM and an IDTURN_TO.
>
> i'll want to SELECT SUM OF GOLHOMETEAM FROM MATCH TABLE WHERE
> TRAINER_TEAM.IDTEAM = MATCH.IDHOMETEAM AND MATCH.IDGROUP.IDTURN.SORT
> >= TRAINER_TEAM.IDTURN_FROM.SORT AND MATCH.IDGROUP.IDTURN.SORT <=

> TRAINER_TEAM.IDTURN_TO.SORT
> AND TRAINER_TEAM.IDTRAINER=5
>
> i hope is understandable.
> please help, is important!!
>
> thank u!


I find it easier to understand a query if the SQL keywords are in upper case
and the table/field references are in lowercase.

Also, setting the query out carefully across multiple lines (as in the
examples in the manuals) helps a lot.

Finally, you started off this post with: "this is my question", but you seem
to have neglected to actually ask anything!

What precisely IS your question?


Reply With Quote
  #3 (permalink)  
Old 05-25-2008
strawberry
 
Posts: n/a
Default Re: MYSQL HELP! :(

On 25 May, 11:33, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
> tranky wrote:
> > Hi people.
> > This is my first thread, i hope you can help me.
> > I'm a newbie and my english is so bad, but, i hope you can understand
> > me. this is my question:

>
> > I've a table TURN with this field
> > IDTURN (int)
> > SEASON (string)
> > SORT (string)

>
> > another table GROUP
> > IDGROUP (int)
> > IDTURN (int)

>
> > a table MATCH
> > IDMATCH (int)
> > IDGROUP (int)
> > IDHOMETEAM (int)
> > GOLHOMETEAM (int)

>
> > and i've another table TRAINER_TEAM
> > IDTRAINER (int)
> > IDTEAM (int)
> > IDTURN_FROM (int)
> > IDTURN_TO (int)

>
> > in this table i've an ID for the trainer, the id of team and the
> > duration of the experience of this trainer with this team. The
> > duration is set up by an IDTURN_FROM and an IDTURN_TO.

>
> > i'll want to SELECT SUM OF GOLHOMETEAM FROM MATCH TABLE WHERE
> > TRAINER_TEAM.IDTEAM = MATCH.IDHOMETEAM AND MATCH.IDGROUP.IDTURN.SORT
> > >= TRAINER_TEAM.IDTURN_FROM.SORT AND MATCH.IDGROUP.IDTURN.SORT <=

> > TRAINER_TEAM.IDTURN_TO.SORT
> > AND TRAINER_TEAM.IDTRAINER=5

>
> > i hope is understandable.
> > please help, is important!!

>
> > thank u!

>
> I find it easier to understand a query if the SQL keywords are in upper case
> and the table/field references are in lowercase.
>
> Also, setting the query out carefully across multiple lines (as in the
> examples in the manuals) helps a lot.
>
> Finally, you started off this post with: "this is my question", but you seem
> to have neglected to actually ask anything!
>
> What precisely IS your question?- Hide quoted text -
>
> - Show quoted text -


Also, when posting to multiple forums, if you're unable to 'crosspost'
at least make reference to the other forums you've posted in so that
we can avoid answering questions that have already been addressed
elsewhere.

To be fair PL there is a sort of question there:

"How do I turn this minglish into a bona fide query?":

SELECT SUM OF GOLHOMETEAM
FROM MATCH TABLE
WHERE
TRAINER_TEAM.IDTEAM = MATCH.IDHOMETEAM
AND MATCH.IDGROUP.IDTURN.SORT >= TRAINER_TEAM.IDTURN_FROM.SORT
AND MATCH.IDGROUP.IDTURN.SORT <= TRAINER_TEAM.IDTURN_TO.SORT
AND TRAINER_TEAM.IDTRAINER=5

Maybe the OP could clarify their requirements by providing a very very
small dataset together with the resultset they'd expect from their
query.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0