×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

columns and data...

columns and data...

columns and data...

(OP)
I have a field USA, and 4 other North-east, south-east, north east and south east. I have to delete these 4 fields . they have data.  I want to have the same info when I query the USA. so i WILL HaVE IN MY TBLE ONLY THE USA and not the regions. How can I do? Thanks

RE: columns and data...

What RDBMS are you using?  If it's Oracle 8i, you can drop the unwanted columns.
Otherwise, you might want to try

Step 1 -
CREATE TABLE temp_mytable AS
SELECT all_columns_except_the_ones_you_do_not_want
FROM my_table;

Step 2 -
DROP TABLE my_table;

Step 3 -
RENAME temp_mytable TO my_table;

RE: columns and data...

(OP)
giving complementary info:
I am using oracle 7 and I have 15 other fields in the same table. can i proceed with your answer. what about the data contained in the fields North-east, north-west, south_west and south_east.  i will lose them, right if I wont select the fields? I want to query the usa field and get the info in the north-east, south-east, north_west and south-west.
thanks again

RE: columns and data...

for your create table, use the following select:
select col1,col2,north-east,col5,col6
from anytable
where north-east is not null
union
select col1,col2,north-WEST,col5,col6
from anytable
where north-WEST is not null
union......

You could modify the where clause further.....
you get the picture?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close