Results 1 to 8 of 8

Thread: Dual Table

  1. #1
    Moderator
    Join Date
    Oct 2005
    Answers
    305

    Dual Table

    If a dual table has 4 records. Which one will be display?

    NOTE : [This question was asked by nagurtilak]


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: Dual Table

    Dual Table is a special kind of table..It has only one row and one column...So it always display one record which is first....

    -------------------
    suresh


  3. #3
    Expert Member
    Join Date
    Nov 2006
    Answers
    518

    Re: Dual Table

    Lokesh M,

    Can you show a DUEL table with 4 rows.
    Just give the SQL statement.

    Thanks in advance


  4. #4
    Moderator
    Join Date
    Oct 2005
    Answers
    305

    Re: Dual Table

    Members,

    Kindly note these questions are not mine, They have been asked by site visitors, I am just posting them at appropriate place.

    Few Questions might be incomplete, Few may be wrong, Lets clarify and share what we know...

    Thanks for all your comments anyway


  5. #5
    Expert Member
    Join Date
    Sep 2006
    Answers
    477

    Re: Dual Table

    Suresh is right. DUAL has only a single row and single column. It is usually used for arithmatic manipulations as a dummy table.

    [COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]

    Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"

  6. #6
    Contributing Member
    Join Date
    Jan 2007
    Answers
    31

    Re: Dual Table

    hi,
    Dual is very special table, one row and one column. well see it below:

    SQL> desc dual;
    Name Null? Type
    ------------------------------- -------- ----
    DUMMY VARCHAR2(1)

    well as u can see the structure of table DUAL, name of the column is DUMMY, and datatype is varchar2(1). (this is very imp. question in interview).

    SQL> select * from dual;

    D
    -
    X

    and here as u can see, it will always have X.

    => in the real time it will be used in coding.
    lets see one scenario, suppose i want the sysdate.
    yes we can use the sysdate the in-built function, it will give the date. but in sql we have to give some tablename after FROM clause. so which table to use, in that case we use dual. and in this case dual is not doing anything, all the operation is done with the sysdate function. so the query we write is :

    sql> select sysdate from dual;

    and more thing friends, i do not think that, dual does any arithmatic manipulations. it never does. its just a coplementary for FROM clause.
    well u can see with this example:

    SQL> select 2+3 from dual;

    2+3
    ---------
    5
    so, the result is correct as expected(beleiving that arithmatic operations are done in dual, then this select stmnt. should fail if we use any other table after FROM). so lets see what happens, i am using other table:

    SQL> select 2+3 from emp;

    2+3
    ---------
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5
    5

    20 rows selected.


    see here also we got the result. so its clear dual does not does any calculations, it only complements FROM clause. and logically also its not possible, just ask a simple question, Can we do any type of calculation inside any field of a record? and the answer is no. so the same thing is applicable for DUAL.

    regards,
    RSY


  7. #7
    Junior Member
    Join Date
    Feb 2007
    Answers
    2

    Re: Dual Table

    Quote Originally Posted by Lokesh M View Post
    If a dual table has 4 records. Which one will be display?

    NOTE : [This question was asked by nagurtilak]
    how u will insert a record in dual table


  8. #8
    Junior Member
    Join Date
    Feb 2007
    Answers
    2

    Re: Dual Table

    how it possible more than one record in dual table


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