Home » SQL & PL/SQL » SQL & PL/SQL » How to select n-1 columns in a table with n columns ?
How to select n-1 columns in a table with n columns ? [message #920] Wed, 13 March 2002 00:47 Go to next message
sorcer
Messages: 19
Registered: January 2002
Junior Member
Hello,
See this example :
TABLE : TB_TEST
COLUMNS : ID, FIRST_NAME, LAST_NAME, ADR_1, ADR_2
I want to select all the columns without ID, i know i can do that : SELECT FIRST_NAME, LAST_NAME, ADR_1, ADR_2 FROM TB_TEST but i don't want to put the names of the columns because the column ID is in all the tables and i want to be able to do a SELECT * FROM ...
without the ID, it was the reason why i don't want to put the names of the columns.
Can anybody help me?
Thank you very much.
Re: How to select n-1 columns in a table with n columns ? [message #921 is a reply to message #920] Wed, 13 March 2002 01:03 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
directly u can not do like that.

one option is to create a view

create or replace view tb_test_view as
SELECT FIRST_NAME, LAST_NAME, ADR_1, ADR_2
FROM TB_TEST;

and then u can say

select * from tb_test_view
Previous Topic: Output file and exit;
Next Topic: utility which selectively updates/inserts a record for given fields
Goto Forum:
  


Current Time: Fri Mar 29 02:16:16 CDT 2024