DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: help neede in creating new table from another table,plzzzzzzzzz help meeeeeee

  1. #1
    Join Date
    May 2007
    Posts
    5

    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

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    did you look at the error and do what it tells you?

  3. #3
    Join Date
    May 2007
    Posts
    11
    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

  4. #4
    Join Date
    Nov 2002
    Location
    Mooresville, NC
    Posts
    349
    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"
    http://www.perf-engg.com
    A performance engineering forum

  5. #5
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    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.

  6. #6
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    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)

  7. #7
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    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.

  8. #8
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    no it wasnt you, it was the other guy

  9. #9
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    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.

  10. #10
    Join Date
    Nov 2002
    Location
    Mooresville, NC
    Posts
    349
    I misread the section. Thought it was not resolved yet.
    http://www.perf-engg.com
    A performance engineering forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width