Re: query issue
From: curwen <josephcurwen_at_despammed.com>
Date: 28 Jan 2004 06:03:50 -0800
Message-ID: <cc68edc4.0401280603.9725566_at_posting.google.com>
max(id) numb
12 123456
Date: 28 Jan 2004 06:03:50 -0800
Message-ID: <cc68edc4.0401280603.9725566_at_posting.google.com>
> Hi jc,
>
> why don't you use the 'progressive id' you mentioned?
> Hint for free: MAX().
>
> hth,
> Guido
because if I do something like:
select max(n_id),n_number from numbers group by n_number
then I get :
max(id) numb
12 123456
I need the fk1 field, too
and
select max(n_id),n_number,fk1 from numbers group by n_number
is not going to work..
I accomplished the mission using:
select * from numbers where n_id in
(select max(n_id) from numbers group by n_number);
but i'm afraid it could be a bottleneck
is there any way to avoid nested queries?
PS i'm sorry for xpost :) Received on Wed Jan 28 2004 - 15:03:50 CET