Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Creating temporary table with ORDER BY and RANGE
Sat, Feb 2 2013 8:36 PMPermanent Link

Hyun Ju Yong

I tried following SQL but always failed.

CREATE TEMPORARY TABLE "temp" AS SELECT * FROM msg order by username RANGE 1 TO 10 WITH DATA

=> ElevateDB Error #700 An error was found in the statement at line 1 and column 52 (Expected WITH but instead found order)

CREATE TEMPORARY TABLE "temp" AS select * from (SELECT * FROM msg order by username RANGE 1 TO 10) aa WITH DATA
=> ElevateDB Error #700 An error was found in the statement at line 1 and column 85 (Invalid expression RANGE found, RANGE clause not allowed)

Can anyone help me?
Sun, Feb 3 2013 4:07 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Hyun


Those subclauses are not supported when creating a table. However, what you can do is create a view and then use that to create the temporary table eg

CREATE VIEW "AdamRange" AS
SELECT * FROM Adam
ORDER BY User DESC
RANGE 1 TO 3

CREATE TEMPORARY TABLE fred AS

SELECT * FROM AdamRange WITH DATA


Roy Lambert [Team Elevate]
Image