Home » SQL & PL/SQL » SQL & PL/SQL » select all but one column from a large table
select all but one column from a large table [message #213517] Thu, 11 January 2007 02:00 Go to next message
steffeli
Messages: 112
Registered: July 2006
Senior Member
hello,

I have a table tab with 200 columns. How can I select all but not column p100 (without writing all 199 column that I want)?

The code should be something like this:

select *
from tab
where column not p100


Can anyone help me to write the code correct?

Thanks
Stefan
Re: select all but one column from a large table [message #213518 is a reply to message #213517] Thu, 11 January 2007 02:01 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You cannot do that. Either generate the query using all_tab_columns or just shut off your mind and go typing.
Re: select all but one column from a large table [message #213614 is a reply to message #213517] Thu, 11 January 2007 08:21 Go to previous messageGo to next message
joy_division
Messages: 4643
Registered: February 2005
Location: East Coast USA
Senior Member
If it's in SQL*Plus, you can just do
column p100 noprint

select * from tab
/
Re: select all but one column from a large table [message #213618 is a reply to message #213517] Thu, 11 January 2007 09:07 Go to previous message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
If it's always the same column being excluded, you could create a view.

Previous Topic: Oracle Function to create .CSV file
Next Topic: drop column p1 if this exists
Goto Forum:
  


Current Time: Thu Dec 08 12:05:43 CST 2016

Total time taken to generate the page: 0.10421 seconds