Or
select (whatever)
from articles a
where (art_date,art_index) =
(select art_date,max(art_index) from articles group by art_date);
> John Hoskins
> TDS Computing Services
> Application Development & Support Team
> [EMAIL PROTECTED]
> 608.664.8263
> 608.664.8288 (fax)
-----Original Message-----
From: Aby Mathew [mailto:[EMAIL PROTECTED]]
Sent: 8/26/1999 3.59 PM
To: 'Rimma'; [EMAIL PROTECTED]
Subject: Re: [ND] Getting the maximum index value for a given date
(Urgent ! Please)
>From your question it is not clear to me what is the result that you
want. But I am sure, whatever it is, it won't be tough to do with SQL.
If what you want is only one row for each date, that being the row with
the highest index for the day, something like this would work:
===================================================================
Selet art_date, art_title -- or whatever
>From articles A
Where NOT exits
( Select * from articles B
Where A.art_date = B.art_date and B.art_index > A.art_index )
===================================================================
Aby
-----Original Message-----
From: Rimma [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 26, 1999 1:11 PM
To: [EMAIL PROTECTED]
Subject: [ND] Getting the maximum index value for a given date (Urgent!
Please)
Hello!
What is the easiest way to get the maximum index value for a given date?
I have a database of articles which all have a Date and Index property.
A few articles
can have the same Date, but all are supposed to have a different Index.
The Date is
assigned in the format (for August 4, 1999) 19990804. To get the Index
value,
"1" is for a given date: 199908041, 199908042, 199908043... etc. For
example, for
August 5, 1999, the date would be 19990805 and the Indexes would be
199908051,
199908052 etc.
I'm thinking about creating a Data Object to get the Date and Index
values of each article,
get all of the Index values for a given date and then getting the
largest index value.
Does anybody know an easy way to do that? Do you have an example?
Thanks,
Rimma
________________________________________________________________________
_
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to:
http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]