![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
-----Original Message----- From: info-ingres-admin (AT) cariboulake (DOT) com [mailto:info-ingres-admin (AT) cariboulake (DOT) com] On Behalf Of morgan brickley Sent: 03 March 2006 12:56 To: info-ingres (AT) cariboulake (DOT) com Subject: [Info-ingres] ORDER BY not allowed when creating temporary tables... Hi there, Can anyone answer this riddle: You can create a temporary table using a select as follows: Declare global temporary table session.temp_table AS (SELECT FIRST 5 timestamp FROM someTable) on commit preserve rows with norecovery; But you can't do this because it has an order by clause: Declare global temporary table session.temp_table AS (SELECT FIRST 5 timestamp FROM someTable ORDER BY timestamp DESC) on commit preserve rows with norecovery; The Q is why allow the 'FIRST' modifer if you can't choose what type of sorting should be done. i.e. the first temporary table is useless as you can't guarantee the elements that will get copyied into the temporary table. Is there some syntax I'm missing here ? Regards to the ingres community, Morgan. _______________________________________________ Info-ingres mailing list Info-ingres (AT) cariboulake (DOT) com http://mailman.cariboulake.com/mailm...py/info-ingres |
![]() |
| Thread Tools | |
| Display Modes | |
| |