Subject RE: [ib-support] How do I select a record which has the highest for a particular column
Author Tony Mays
this will give you a max for each condition where the group by fields are
different:
select field1, field2, feidl3, max(field4) from table1 group by
field1,field2,field3;

to specify only a particular record:
select field1, field2, field3, max(field4)
from table1
where field1 = somefield1value
and field2 = somefield2value
and field3 = somefield3value
group by field1,field2,field3;

give this a try. hope it helps

tony



-----Original Message-----
From: ibrahim Bulut [mailto:ibrahim@...]
Sent: Thursday, April 11, 2002 12:06 AM
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] How do I select a record which has the highest
for a particular column


SELECT * FROM TABLE1
WHERE FIELD1 = (SELECT MAX(FIELD1) FROM TABLE1)


Ibrahim Bulut
Software Developer
Republic of Turkey



----- Original Message -----
From: "Amrita Chaudhury" <achaudhu@...>
To: <ib-support@yahoogroups.com>
Sent: Wednesday, April 10, 2002 10:21 PM
Subject: [ib-support] How do I select a record which has the highest for a
particular column


> Please help !!!
>
> I cant do select * from report_new(date) where attempts= max(attampts).
> Where attempts is a column..
>
> What is the closest way to get the entire record, I dont want to invoke
the
> procedure twice ?
>
> amrita .
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>



To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/