pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
CREATE TABLE AS and ORDER BY
4+ messages / 4 participants
[nested] [flat]

* CREATE TABLE AS and ORDER BY
@ 2001-02-06 02:01 Joy Chuang <hxc0850@omega.uta.edu>
  2001-02-06 16:05 ` Re: CREATE TABLE AS and ORDER BY Tom Lane <tgl@sss.pgh.pa.us>
  2001-02-06 18:13 ` Re: CREATE TABLE AS and ORDER BY Jie Liang <jliang@ipinc.com>
  2001-02-23 09:16 ` Re: CREATE TABLE AS and ORDER BY CM <news_shield@themus.com>
  0 siblings, 3 replies; 4+ messages in thread

From: Joy Chuang @ 2001-02-06 02:01 UTC (permalink / raw)
  To: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: CREATE TABLE AS and ORDER BY
  2001-02-06 02:01 CREATE TABLE AS and ORDER BY Joy Chuang <hxc0850@omega.uta.edu>
@ 2001-02-06 16:05 ` Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2001-02-06 16:05 UTC (permalink / raw)
  To: Joy Chuang <hxc0850@omega.uta.edu>; +Cc: pgsql-sql

Joy Chuang <hxc0850@omega.uta.edu> writes:
> But, it returns error message "ERROR:  parser: parse error at or near
> "order"".  Does "create table as" support "order by" inside of it?

Evidently not.

> I am using PostgreSQL 6.5.3.

It seems to work in 7.0 and later.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: CREATE TABLE AS and ORDER BY
  2001-02-06 02:01 CREATE TABLE AS and ORDER BY Joy Chuang <hxc0850@omega.uta.edu>
@ 2001-02-06 18:13 ` Jie Liang <jliang@ipinc.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Jie Liang @ 2001-02-06 18:13 UTC (permalink / raw)
  To: Joy Chuang <hxc0850@omega.uta.edu>; +Cc: pgsql-sql

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
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: CREATE TABLE AS and ORDER BY
  2001-02-06 02:01 CREATE TABLE AS and ORDER BY Joy Chuang <hxc0850@omega.uta.edu>
@ 2001-02-23 09:16 ` CM <news_shield@themus.com>
  2 siblings, 0 replies; 4+ messages in thread

From: CM @ 2001-02-23 09:16 UTC (permalink / raw)
  To: pgsql-sql


"Joy Chuang" <hxc0850@omega.uta.edu> wrote in message
news:3A7F5AF9.B23DF42F@omega.uta.edu...
> 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.

When you CREATE TABLEs you don't say anything about ordering.  I should say
it doesn't matter what the order is.  When you SELECT from the table you can
use ORDER BY.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-02-23 09:16 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-06 02:01 CREATE TABLE AS and ORDER BY Joy Chuang <hxc0850@omega.uta.edu>
2001-02-06 16:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-02-06 18:13 ` Jie Liang <jliang@ipinc.com>
2001-02-23 09:16 ` CM <news_shield@themus.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox