Re: HELP: How to rewrite sorted records back to a table?

From: jeff davidson <davidson_at_ix.netcom.com>
Date: 1996/09/23
Message-ID: <32474633.2D0B_at_ix.netcom.com>#1/1


> > rename your table and create a view that reads something like:
> > create view emp as select * from emp_old order by deptno.
>
> You can't (in 7.1) put an order by in a view
> But what you can do is to create an index on the order by columns.
>
> so
> - rename the table
> - create a suitable index
> - create a view with a where clause WHERE COLUMN > 'minimum value'.
>
> make sure that the column does not contain any nulls otherewise these
> will be skipped.
>
> The where clause will cause the index to be used and return rows in index
> sequence
>
> Rgds Paul Tame.
 

  :^)
As I was writing my reply it occurred to me that an order by might not work in a view. I think (though I'm no longer too sure) your idea should work but
I'm not sure it's "guaranteed" to work. I think the official line is if you
don't have an order by, order can not be predicted. Received on Mon Sep 23 1996 - 00:00:00 CEST

Original text of this message