Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL and Oracle Tuning
If you want more control over the appearance of the columns that you are
querying you would use the second (column order specific) select statement.
The would be the preferred syntax if you were selecting these columns into a
list
of variables for further processing. If for some reason the table
definition itself
should change or it was created in another schema with a different column
order and you
just use select *, your "into" column list is hosed.
Other than that there is really not a significant difference between the 2
select
statements.
--
Shirley Burk
sburk_at_gte.net
jayu_c_at_my-dejanews.com wrote in message <6sbpg2$fud$1_at_nnrp1.dejanews.com>...
>This was a question asked during an interview
>
>Table emp has three columns :
>
>empno
>ename
>dept_code
>
>Now if u write :
>
>SELECT * FROM EMP;
>and
>SELECT empno,ename,dept_code FROM EMP;
>
>Which statement is more optimal and why?
>
>I have already tried an 'explain plan' on them - it yields similar results.
>That is, a full table access is carried out for both statements.
>
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Received on Sun Aug 30 1998 - 21:29:22 CDT
![]() |
![]() |