Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #975
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
|---|---|
| From | bradbury9 <ray.bradbury9@gmail.com> |
| Newsgroups | comp.databases.ms-sqlserver |
| Subject | Re: Database query -- how to? |
| Date | Thu, 12 Apr 2012 04:10:36 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 37 |
| Message-ID | <26142844.921.1334229036077.JavaMail.geo-discussion-forums@ynkf14> (permalink) |
| References | <67dc35a7-ea2e-4eb1-8bd4-7c7218c1e8e2@2g2000yqp.googlegroups.com> <33102916.190.1334222912192.JavaMail.geo-discussion-forums@vbbbg2> <14349368.675.1334223516823.JavaMail.geo-discussion-forums@yneo2> |
| NNTP-Posting-Host | 195.57.19.36 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | posting.google.com 1334229895 16484 127.0.0.1 (12 Apr 2012 11:24:55 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Thu, 12 Apr 2012 11:24:55 +0000 (UTC) |
| In-Reply-To | <14349368.675.1334223516823.JavaMail.geo-discussion-forums@yneo2> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=195.57.19.36; posting-account=jIl9nQoAAAA9P37IIqQq64yAx-2NQYiu |
| User-Agent | G2/1.0 |
| X-Received-Bytes | 2322 |
| Xref | csiph.com comp.databases.ms-sqlserver:975 |
Show key headers only | View raw
El jueves, 12 de abril de 2012 11:38:36 UTC+2, Gerd Brix escribió: > Am Donnerstag, 12. April 2012 11:28:32 UTC+2 schrieb bradbury9: > > El jueves, 12 de abril de 2012 10:02:09 UTC+2, Gerd Brix escribió: > [...] > > > There's a SQL Server Express with the following table: > > > > > > ID TIME > > > ---------------- > > > 1 8:00 > > > 1 7:45 > > > 2 6:00 > > > 3 5:00 > > > 2 7:59 > > > > > > What I need to find out is the last time entered for all given IDs. > > > That means: > > > ID TIME > > > ---------------- > > > 1 8:00 > > > 2 7:59 > > > 3 5:00 > > > > > > Can someone please help me with this? > > > > [...] > > In case the column TIME is DateTime type: > > Select max(TIME) from TableName > > > [...] > > Not really :-( This only delivers the latest entry. What I need is the latest entry for each ID. The example result shows this: 3 rows instead of only 1. > > -gerd select [id], max(time) as latestTime from tableName group by [id]
Back to comp.databases.ms-sqlserver | Previous | Next — Previous in thread | Next in thread | Find similar
Database query -- how to? Gerd Brix <gbrix@gmx.de> - 2012-04-12 01:02 -0700
Re: Database query -- how to? bradbury9 <ray.bradbury9@gmail.com> - 2012-04-12 02:28 -0700
Re: Database query -- how to? Gerd Brix <gbrix@gmx.de> - 2012-04-12 02:38 -0700
Re: Database query -- how to? bradbury9 <ray.bradbury9@gmail.com> - 2012-04-12 04:10 -0700
Re: Database query -- how to? Erland Sommarskog <esquel@sommarskog.se> - 2012-04-12 11:10 +0000
Re: Database query -- how to? Gerd Brix <gbrix@gmx.de> - 2012-04-12 04:33 -0700
csiph-web