-
help neede in creating new table from another table,plzzzzzzzzz help meeeeeee
hi i m working in oracle8i sql plus i have one sql querry but it is not executing instead givivng msg that
1* create table totals as select rno,sum(mark) from marks group by rno
and system gives message that
create table totals as select rno,sum(mark) from marks group by rno
*
ERROR at line 1:
ORA-00998: must name this expression with a column alias
so solve my doubt plzzzzzzz
whether my querry is wrong?????????
or not?
plz help me i have to create secondary table
ragrds
abhinav pandey
-
did you look at the error and do what it tells you?
-
You need to alias the sum(mark)
create table totals as select rno,sum(mark) mysum from marks group by rno
Notice that "mysum" might not be a good column name for you
-
I do not see any prob. I created the tavble using this.
SQL> create table b as select rno,sum(mark) mysum from a group by rno;
Table created.
Elapsed: 00:00:00.54
R u sure "rno, mark are 2 column names of mark table"
-
You had no problems creating the table 'cause of you used an alias for your sum() column -as thapush advised, while original poster didn't.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
and it was riased and solved 2 weeks ago, why the need to do re-open it and add nothing useful or insightful (pretty much like the rest of your posts)
-
r u talking to me?
#1- It wasn't me the one who re-open the it
#2- I pointed to Malay why he had no issues creating the table
Anything else I can help with?
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
no it wasnt you, it was the other guy
-
Fair enough Dave.
The entente cordiale is safe for another hundred years now
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
I misread the section. Thought it was not resolved yet.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|