GROUP BY...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dominique Javet

    GROUP BY...

    Hello,

    I've a little problem with GROUP BY for my query:

    SELECT
    `rel_experience _client`.`clien t_ref`,
    `client`.`id`,
    `rel_experience _client`.`exper ience_ref`,
    `experience`.`i d` AS `id1`,
    `experience`.`t itre_fr`,
    `client`.`libel le`
    FROM
    `rel_experience _client`
    INNER JOIN `client` `client1` ON (`rel_experienc e_client`.`clie nt_ref` =
    `client1`.`id`)
    INNER JOIN `experience` ON (`rel_experienc e_client`.`expe rience_ref` =
    `experience`.`i d`)
    RIGHT OUTER JOIN `client` ON (`rel_experienc e_client`.`clie nt_ref` =
    `client`.`id`)
    ORDER BY
    `client`.`libel le`

    Here's the result:
    -> http://www.metadelic.com/rapport.htm

    And here's what I wish to have without including the colmn "client_ref " for
    the result:
    -> http://www.metadelic.com/rapport.htm#result

    I can't work it out...
    Any suggestion on how to do?


    Regards, Dom


  • Erwin Moller

    #2
    Re: GROUP BY...

    Dominique Javet wrote:
    [color=blue]
    > Hello,
    >
    > I've a little problem with GROUP BY for my query:
    >
    > SELECT
    > `rel_experience _client`.`clien t_ref`,
    > `client`.`id`,
    > `rel_experience _client`.`exper ience_ref`,
    > `experience`.`i d` AS `id1`,
    > `experience`.`t itre_fr`,
    > `client`.`libel le`
    > FROM
    > `rel_experience _client`
    > INNER JOIN `client` `client1` ON (`rel_experienc e_client`.`clie nt_ref` =
    > `client1`.`id`)
    > INNER JOIN `experience` ON (`rel_experienc e_client`.`expe rience_ref` =
    > `experience`.`i d`)
    > RIGHT OUTER JOIN `client` ON (`rel_experienc e_client`.`clie nt_ref` =
    > `client`.`id`)
    > ORDER BY
    > `client`.`libel le`
    >
    > Here's the result:
    > -> http://www.metadelic.com/rapport.htm
    >
    > And here's what I wish to have without including the colmn "client_ref "
    > for the result:
    > -> http://www.metadelic.com/rapport.htm#result
    >
    > I can't work it out...
    > Any suggestion on how to do?
    >
    >
    > Regards, Dom[/color]


    Hi Dominique,

    What is it that you want?
    You example is completely unclear to me.
    In your posting you use ORDER BY, but in your topic you use GROUP BY.
    These two are completely unrelated SQL commands.

    If you use a GROUP BY, you need to define at least ONE AGRREGATE in your
    query, which you didn't.

    Please have a look at: http://www.w3schools.com/sql/default.asp for a very
    good quick introduction to SQL. Both GROUP BY and ORDER BY are covered in
    that tutorial. It is a great SQL primer.

    I am sure you can rewrite your query after reading that tutorial so it will
    do what you want.

    Good luck!

    Regards,
    Erwin Moller

    Comment

    • Dominique Javet

      #3
      Re: GROUP BY...

      Hello,

      Correct, I don't have included GROUP BY because I dont have a interessant
      result with...
      So I think it's better to not include something incomplete.. no?

      I still now the GROUP BY synthax (and the site you gave me), but I wish to
      group 1 colmn and a another and it's not alphabetical...
      BTW, thx, I'm still looking.

      Regards, Dom



      "Erwin Moller"
      <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in
      message news:409a589c$0 $561$e4fe514c@n ews.xs4all.nl.. .[color=blue]
      > Dominique Javet wrote:
      >[color=green]
      > > Hello,
      > >
      > > I've a little problem with GROUP BY for my query:
      > >
      > > SELECT
      > > `rel_experience _client`.`clien t_ref`,
      > > `client`.`id`,
      > > `rel_experience _client`.`exper ience_ref`,
      > > `experience`.`i d` AS `id1`,
      > > `experience`.`t itre_fr`,
      > > `client`.`libel le`
      > > FROM
      > > `rel_experience _client`
      > > INNER JOIN `client` `client1` ON (`rel_experienc e_client`.`clie nt_ref` =
      > > `client1`.`id`)
      > > INNER JOIN `experience` ON (`rel_experienc e_client`.`expe rience_ref` =
      > > `experience`.`i d`)
      > > RIGHT OUTER JOIN `client` ON (`rel_experienc e_client`.`clie nt_ref` =
      > > `client`.`id`)
      > > ORDER BY
      > > `client`.`libel le`
      > >
      > > Here's the result:
      > > -> http://www.metadelic.com/rapport.htm
      > >
      > > And here's what I wish to have without including the colmn "client_ref "
      > > for the result:
      > > -> http://www.metadelic.com/rapport.htm#result
      > >
      > > I can't work it out...
      > > Any suggestion on how to do?
      > >
      > >
      > > Regards, Dom[/color]
      >
      >
      > Hi Dominique,
      >
      > What is it that you want?
      > You example is completely unclear to me.
      > In your posting you use ORDER BY, but in your topic you use GROUP BY.
      > These two are completely unrelated SQL commands.
      >
      > If you use a GROUP BY, you need to define at least ONE AGRREGATE in your
      > query, which you didn't.
      >
      > Please have a look at: http://www.w3schools.com/sql/default.asp for a very
      > good quick introduction to SQL. Both GROUP BY and ORDER BY are covered in
      > that tutorial. It is a great SQL primer.
      >
      > I am sure you can rewrite your query after reading that tutorial so it[/color]
      will[color=blue]
      > do what you want.
      >
      > Good luck!
      >
      > Regards,
      > Erwin Moller[/color]


      Comment

      Working...