asp_ado_rds thread: SQL Statement Question
Message #1 by "Ozgur Zan" <zanoz@y...> on Wed, 8 Nov 2000 16:57:36 +0200
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_005A_01C049A4.FF0BC700
Content-Type: text/plain;
charset="iso-8859-9"
Content-Transfer-Encoding: quoted-printable
What is the SQL statement which returns the following recordset:
(latest dates of all users)
u1 8.11.2000
u2 10.11.2000
u3 9.11.2000
from the following database:
username date
u1 8.11.2000
u1 8.10.2000
u2 7.11.2000
u2 10.11.2000
u3 9.11.2000
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Message #2 by "Muazzam Aumeerally" <muazm@h...> on Wed, 08 Nov 2000 10:47:58 EST
|
|
select username, max(date) from table;
>From: "Ozgur Zan" <zanoz@y...>
>Reply-To: "ASP_ADO_RDS" <asp_ado_rds@p...>
>To: "ASP_ADO_RDS" <asp_ado_rds@p...>
>Subject: [asp_ado_rds] SQL Statement Question
>Date: Wed, 8 Nov 2000 16:57:36 +0200
>
>What is the SQL statement which returns the following recordset:
>(latest dates of all users)
>
>u1 8.11.2000
>u2 10.11.2000
>u3 9.11.2000
>
>from the following database:
>
>username date
>u1 8.11.2000
>u1 8.10.2000
>u2 7.11.2000
>u2 10.11.2000
>u3 9.11.2000
>
>
Message #3 by "Muazzam Aumeerally" <muazm@h...> on Wed, 08 Nov 2000 11:10:49 EST
|
|
The SQL statement is :
select username, max(date) from tablename
group by username;
>From: "Ozgur Zan" <zanoz@y...>
>Reply-To: "ASP_ADO_RDS" <asp_ado_rds@p...>
>To: "ASP_ADO_RDS" <asp_ado_rds@p...>
>Subject: [asp_ado_rds] SQL Statement Question
>Date: Wed, 8 Nov 2000 16:57:36 +0200
>
>What is the SQL statement which returns the following recordset:
>(latest dates of all users)
>
>u1 8.11.2000
>u2 10.11.2000
>u3 9.11.2000
>
>from the following database:
>
>username date
>u1 8.11.2000
>u1 8.10.2000
>u2 7.11.2000
>u2 10.11.2000
>u3 9.11.2000
>
>
>
|