Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f16IDNx21995 for ; Tue, 6 Feb 2001 13:13:23 -0500 (EST) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id KAA46276; Tue, 6 Feb 2001 10:13:04 -0800 (PST) (envelope-from jliang@tidal.ipinc.com) Date: Tue, 6 Feb 2001 10:13:04 -0800 (PST) From: Jie Liang To: Joy Chuang cc: pgsql-sql@postgresql.org Subject: Re: CREATE TABLE AS and ORDER BY In-Reply-To: <3A7F5AF9.B23DF42F@omega.uta.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200102/89 X-Sequence-Number: 1267 Hey, Try: select e.studentid, u.hoursxfer into freshhr21 from enrollmentstatus e, undergradclass u where e.studentid = u.studentid and e.classtd = '1' order by u.hoursxfer Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com On Mon, 5 Feb 2001, Joy Chuang wrote: > Hi, > > I tried to use CREATE TABLE AS and ORDER BY. The query is as followed: > > create table freshhr21 as > select e.studentid, u.hoursxfer > from enrollmentstatus e, undergradclass u > where e.studentid = u.studentid and e.classtd = '1' > order by u.hoursxfer > > But, it returns error message "ERROR: parser: parse error at or near > "order"". Does "create table as" support "order by" inside of it? > > I am using PostgreSQL 6.5.3. > > Thank you. > > Joy Chuang >