[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: order by problem
> Hi again. Okay, the problem is this: I have two fields, A and B. Both
> fields hold the same kind of data (a 9-digit number). Most of the time I
> wish to order by field A, but when field B is filled in, I wish to
> include it in the ordering. For example:
>
> Field A Field B
> ------- -------
> 1 empty
> 4 5
> 7 6
> 9 empty
>
> I would like the final ordering to be 1, 5, 6, 9. Is this possible?
It depends on what you mean by "include it in the ordering".
try: order by nvl(b,a)
or : order by b||a
depending on what you mean
Ray
----------------------------------------------------------------------
Ray Ontko | Ray Ontko & Co | "Ask me about SQR"
rayo@ontko.com | Richmond, In | See us at http://www.ontko.com/