Forum Moderators: open

Message Too Old, No Replies

Making a table from a select.

create table as (select etc...

         

JebbyToast

5:46 pm on Nov 20, 2007 (gmt 0)

10+ Year Member



Can anyone tell me why this is giving me the "missing right parenthesis"? And I wont accept "Because it's missing a right parenthesis!" ;)

Here is my query...

create table CE3or31
as (select o.repcode, firstname, lastname, o.eftstart
from rep r, repother o
where r.repcode = o.repcode
and (lictype0 = 31 OR
lictype1 = 31 OR
lictype2 = 31 OR lictype3 = 31
OR lictype4 = 31 OR lictype5 = 31 OR lictype6 = 31
or lictype7 = 31 or lictype8 = 31 or lictype9 = 31
or lictype0 = 3 or lictype1 = 3 or lictype2 = 3
or lictype3 = 3 or lictype4 = 3 or lictype5 = 3
or lictype6 = 3 or lictype7 = 3 or lictype8 = 3
or lictype9 = 3)
and lastname not like '%TERM'
order by lastname)

Thanks for the help!

phranque

2:11 am on Nov 21, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the final closing parenthesis is a phrase late or something like that.
try:

...)
and lastname not like '%TERM')
order by lastname

ZydoSEO

7:30 pm on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



remove the ORDER BY LASTNAME. Not sure you can use the ORDER BY clause withing a CREATE AS SELECT statement. I believe that was what the previous poster was also trying to say.

JebbyToast

4:20 pm on Nov 27, 2007 (gmt 0)

10+ Year Member



Awesome guys, thanks for the help.