Professional Web Applications Themes

GROUP BY cluse - MySQL

I am trying to use GROUP BY cluse, what is the utility of this cluse in MySQL plz. any body tell me...

  1. #1

    Default GROUP BY cluse

    I am trying to use GROUP BY cluse, what is the utility of this cluse in
    MySQL
    plz. any body tell me

    jatrojoomla Guest

  2. #2

    Default Re: GROUP BY cluse

    jatrojoomla wrote:
    > I am trying to use GROUP BY cluse, what is the utility of this cluse in
    > MySQL
    > plz. any body tell me
    >
    I'm not sure what you're asking. What are you trying to do?

    P.S. This isn't a php question. It's strictly a SQL question.
    alt.php.sql and php.general removed from the reply.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  3. #3

    Default Re: GROUP BY cluse

    jatrojoomla wrote:
    > I am trying to use GROUP BY cluse, what is the utility of this cluse in
    > MySQL
    > plz. any body tell me
    >
    Not sure, by your question, if you are asking how to use GROUP BY
    clause. If you are then look here:

    [url]http://dev.mysql.com/doc/refman/5.1/en/group-by-modifiers.html[/url]

    --
    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA [url]http://weconsultants.phpnet.us[/url]
    'If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)
    IchBin Guest

  4. #4

    Default Re: GROUP BY cluse

    It works basically the same as in other SQL driven databases, excepting that
    it uses single quotes for instead of double.

    Sample of character, numerical, and table to table link in WHERE clause:

    WHERE table1.field1 = 'some parameter' AND table1.field2 = 6 AND
    table1.field5 = table3.field1

    With character and date fields use single quote marks around the parameter
    value, and skip the single quotes for numerical arguments.

    This is the basic structure, but you can do far more operators and
    nestings... but it is basically SQL 92 compliant (depending on your version
    of MySQL, which you did not specify).

    Cheers!

    ~ Duane Phillips.

    "jatrojoomla" <jatrojoomla> wrote in message
    news:1156770696.026364.28525074g2000cwt.googlegro ups.com...
    >I am trying to use GROUP BY cluse, what is the utility of this cluse in
    > MySQL
    > plz. any body tell me
    >

    Duane Phillips Guest

  5. #5

    Default Re: GROUP BY cluse

    example: SELECT * FROM abc WHERE name='abc' GROUP BY age

    jatrojoomla wrote:
    > I am trying to use GROUP BY cluse, what is the utility of this cluse in
    > MySQL
    > plz. any body tell me
    Justin Guest

  6. #6

    Default Re: GROUP BY cluse

    OK. I posted my answer to the wrong message. *sigh*. Not my day.

    And Group By has been handled enough by the other posters...

    Cheers...

    "Duane Phillips" <duane.phillipsaskme.askme> wrote in message
    news:-audnb5pUZioDW7ZnZ2dnUVZ_rOdnZ2dgiganews.com...
    > It works basically the same as in other SQL driven databases, excepting
    > that it uses single quotes for instead of double.
    >
    > Sample of character, numerical, and table to table link in WHERE clause:
    >
    > WHERE table1.field1 = 'some parameter' AND table1.field2 = 6 AND
    > table1.field5 = table3.field1
    >
    > With character and date fields use single quote marks around the parameter
    > value, and skip the single quotes for numerical arguments.
    >
    > This is the basic structure, but you can do far more operators and
    > nestings... but it is basically SQL 92 compliant (depending on your
    > version of MySQL, which you did not specify).
    >
    > Cheers!
    >
    > ~ Duane Phillips.
    >
    > "jatrojoomla" <jatrojoomla> wrote in message
    > news:1156770696.026364.28525074g2000cwt.googlegro ups.com...
    >>I am trying to use GROUP BY cluse, what is the utility of this cluse in
    >> MySQL
    >> plz. any body tell me
    >>
    >
    >

    Duane Phillips Guest

  7. #7

    Default Re: GROUP BY cluse

    Justin wrote: 
    >[/ref]

    That isn't really useful, however.

    A real application would be, for example, "SELECT age FROM abc GROUP BY age",
    which does the same job as "SELECT DISTINCT age ...", selecting only those ages
    that are different.

    Or "SELECT age,count(*) FROM abc GROUP BY age", which will count the records for
    each value of age.

    --
    CB
    Christoph Guest

Similar Threads

  1. "group by" - order of rows in group
    By aljosa.mohorovic@gmail.com in forum MySQL
    Replies: 1
    Last Post: September 1st, 08:50 AM
  2. New group
    By James Jones in forum ASP Components
    Replies: 0
    Last Post: July 27th, 01:44 AM
  3. May 29 Sydney Developers Group study group
    By 105 in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 25th, 02:56 PM
  4. cfgrid inside a <cfoutput query="myQuery" group="GROUP">
    By DavidGhous in forum Coldfusion Flash Integration
    Replies: 1
    Last Post: April 12th, 07:23 PM
  5. HELP - GROUP
    By SCREEN4ME in forum Macromedia Freehand
    Replies: 4
    Last Post: April 8th, 06:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139