Re: sql question

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks Matt,... that was close enough. Here's the statement.

select * from inventory where partNbr < lastPartNbr order by partNbr desc"

george

----- Original Message -----
From: "Matt Lewis" <matthewwalkerlewis at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: sql question


>
>
> --- George Walters <gwalters at sc.rr.com> wrote:
> >
> >
> > I would like to find a customer or part number in a data base then
scroll
> > (next and/or previous) around that customer or part number.
> >
> > For example I have tried "select * from inventory where partNbr =
1234".....
> > then "select * from inventory where partNbr < lastPartNbr" but that
doesen't
> > work. It will give me the first in the file.... which is a lesser number
but
> > not the lesser one in index order. But strangely enough "select * from
> > inventory where partNbr > lastPartNbr" does give me the next in index
order.
> >
> > Any body got any ideas on this?
>
> Your first try should give you all parts less than, but probably sorted in
a
> non-useful way.  Try:
>
> select * from inventory where partNbr < lastPartNbr order desc by partNbr
>
> And you should have them in a useful order.  Likewise, I'd recommend:
>
> select * from inventory where partNbr > lastPartNbr order by partNbr
>
> Matt Lewis
>
>
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu