pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: aicean <aicean@netspeed-tech.com>
To: pgsql-sql@postgresql.org
Subject: How can I produce the following desired result?
Date: Wed, 15 Oct 2003 10:09:11 +0800
Message-ID: <003401c392c1$86c75660$9e00a8c0@aicean> (raw)

How can I produce the following desired result?

    goodid        totalnum   operationdate storehistoryid 
       132          35.000      09-28-2003             66 
       135          11.500      09-28-2003             61 
       132          35.000      09-27-2003             60 
       135          11.000      09-28-2003             59 
       135          12.000      09-28-2003             58 
       134         100.000      09-28-2003             57 
       134         112.000      09-27-2003             56 
       131           0.000      09-26-2003             54 
       131          33.000      09-26-2003             51 
       131          -2.000      09-26-2003             50 
         3         550.000      09-26-2003             49 
         3          52.000      09-26-2003             48 
       132          35.000      09-27-2003             42 
         3         124.000      09-25-2003             41 
       131          59.000      09-25-2003             40 
       132          57.000      09-26-2003             39 
       131           2.000      09-24-2003             38 
          3           2.000      09-20-2003             23 
      
result:

    goodid        totalnum   operationdate storehistoryid 
       132          35.000      09-28-2003             66 
       135          11.500      09-28-2003             61      
       134         100.000      09-28-2003             57 
       131           0.000      09-26-2003             54 
         3         550.000      09-26-2003             49          

I need   to select rows which storehistoryid is max as the same goodid .


Thanks  in advance


 aicean
 Mailto:aicean@netspeed-tech.com

view thread (5+ messages)  latest in thread

Message-ID: <003401c392c1$86c75660$9e00a8c0@aicean>
Permalink:  ../003401c392c1$86c75660$9e00a8c0@aicean/
Also on:    postgresql.org/message-id/003401c392c1$86c75660$9e00a8c0@aicean

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: aicean@netspeed-tech.com
  Subject: Re: How can I produce the following desired result?
  In-Reply-To: <003401c392c1$86c75660$9e00a8c0@aicean>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox