[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?
Okay, you didn't specify your DBMS. (This isn't really an SQR question,
but rather an SQL question, for some value of SQL.)
I think in Sybase something like:
order by isnull(FieldB, FieldA)
should work.
Craig Jackson
Craig_Jackson@iacnet.com
Electronic Publishing,
Information Access Company