Loading ...
Sorry, an error occurred while loading the content.

Tired today drawing a blank on simple query

Expand Messages
  • Charles Carroll
    Who Quan insTime Ted 35 10:15am Bill 22 10:02am Jenny 44 11:15am Phil 13 10:01am Ted 22 10:25am Jenny 55 11:38am Phil 413 11:55am Bill 13 10:55am Simple query
    Message 1 of 2 , Sep 6, 2012
    • 0 Attachment
      Who Quan insTime
      Ted 35 10:15am
      Bill 22 10:02am
      Jenny 44 11:15am
      Phil 13 10:01am
      Ted 22 10:25am
      Jenny 55 11:38am
      Phil 413 11:55am
      Bill 13 10:55am

      Simple query that just returns last quantity for each i.e.

      Bill 13 10:55am
      Jenny 55 11:38am
      Phil 413 11:55am
      Ted 22 10:25am

      I keep constructing a bunch of misses. Can't believe I can do much more
      complex things but this one stumps me.


      [Non-text portions of this message have been removed]
    • John Warner
      SELECT Who , Quan , MAX(insTime) FROM table GROUP BY Who , Quan Might be a bit off on the syntax here but you want the MAX() aggregate function. HTH John
      Message 2 of 2 , Sep 7, 2012
      • 0 Attachment
        SELECT
        Who
        , Quan
        , MAX(insTime)
        FROM table
        GROUP BY
        Who
        , Quan

        Might be a bit off on the syntax here but you want the MAX() aggregate
        function.

        HTH

        John Warner


        -----Original Message-----
        From: SQLQueriesNoCode@yahoogroups.com
        [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Charles Carroll
        Sent: Friday, September 07, 2012 12:57 AM
        To: SQLQueriesNoCode@yahoogroups.com
        Subject: [SQLQueriesNoCode] Tired today drawing a blank on simple query

        Who Quan insTime
        Ted 35 10:15am
        Bill 22 10:02am
        Jenny 44 11:15am
        Phil 13 10:01am
        Ted 22 10:25am
        Jenny 55 11:38am
        Phil 413 11:55am
        Bill 13 10:55am

        Simple query that just returns last quantity for each i.e.

        Bill 13 10:55am
        Jenny 55 11:38am
        Phil 413 11:55am
        Ted 22 10:25am

        I keep constructing a bunch of misses. Can't believe I can do much more
        complex things but this one stumps me.


        [Non-text portions of this message have been removed]



        ------------------------------------

        Yahoo! Groups Links
      Your message has been successfully submitted and would be delivered to recipients shortly.