Re: Unable to use ORDER BY in an INSERT statement

From: Gary Myers <101355.3556_at_CompuServe.COM>
Date: 1996/02/12
Message-ID: <4fo2ls$9jv$2_at_mhadf.production.compuserve.com>#1/1


Someone recently came up with one method at work.  Put an index on the column you want to order by (if one doesn't exist already), then you INSERT ..... SELECT ... WHERE order_col BETWEEN  minumum value of order_col on table AND max value of order_col on table.  You might have to force it to use the index if you have got cost based optimization.

   gary

-- 
Gary Myers, Analyst/Programmer, Kaisha Technology, West of England
Received on Mon Feb 12 1996 - 00:00:00 CET

Original text of this message