Results 1 to 7 of 7

Thread: Move columns from different tables to one table

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Apr 2008
    Answers
    15

    Re: Move columns from different tables to one table

    u can do this by using select into query.........

    For Ex,

    Select dno,sal into depsal from dept,emp where sal>1000
    select * fom depsal


    then we get the new table depsal with dno,sal whose sal >1000........


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Move columns from different tables to one table

    Quote Originally Posted by ushalakshmi View Post
    u can do this by using select into query.........

    For Ex,

    Select dno,sal into depsal from dept,emp where sal>1000
    select * fom depsal


    then we get the new table depsal with dno,sal whose sal >1000........
    Select into is used in PL/SQL to dump value of a column to a variable. It will not create a new table.

    In a single statemt you can do it in the following way
    CREATE TABLE deptwisesal AS
    SELECT emp.sal, dept.deptno
    FROM emp,dept
    where emp.deptno = dept.deptno;


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Move columns from different tables to one table

    Quote Originally Posted by ushalakshmi View Post
    Select dno,sal into depsal from dept,emp where sal>1000
    select * fom depsal
    that will not create a table for you .


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact