| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Efficient query to fetch the columns in an entire relation?
> Yesterday, I came across one simple question yet interesting.
>
> What is the best way of retrieving all columns in a given relation
> using a SQL query.
>
> Two possible alternatives are
>
> 1. SELECT * FROM relation_name;
>
> 2. SELECT COLUMN1, COLUMN2, ..., COLUMNn FROM relation_name;
>
> I am not able to decide, which is better than the other and more
> importantly
> WHY?
I'm pretty sure that option 2 is best. If you explicitly state the columns
you want, the database doesn't have to waste effort querying the
data-dictionary to work out what columns are available to select.
Tobin
> Hope to get some reply on this,
>
> - Vijay
Received on Wed Jul 17 2002 - 10:00:13 CDT
![]() |
![]() |