Home » SQL & PL/SQL » SQL & PL/SQL » Table deletion (oracle 9i windows xp)
Table deletion [message #333680] Mon, 14 July 2008 02:57 Go to next message
washer84
Messages: 5
Registered: July 2008
Location: India
Junior Member
I have a table that contain 3 million resords.. i want to keep 1 million records and delete the rest..
please give me the best query for this.. i do not wish to roll back these records
am looking for a query which will help me to reduce the time required to delete..
Re: Table deletion [message #333686 is a reply to message #333680] Mon, 14 July 2008 03:05 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
google is your friend
Re: Table deletion [message #333687 is a reply to message #333680] Mon, 14 July 2008 03:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Did you try DELETE?

You can read these 2 threads from AskTom:
How to Update millions or records in a table
Deleting many rows from a big table

Regards
Michel
Re: Table deletion [message #333689 is a reply to message #333687] Mon, 14 July 2008 03:08 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Michel Cadot wrote on Mon, 14 July 2008 09:06
Did you try DELETE?


./fa/449/0/
Very droll Michel.
Re: Table deletion [message #333693 is a reply to message #333680] Mon, 14 July 2008 03:18 Go to previous messageGo to next message
washer84
Messages: 5
Registered: July 2008
Location: India
Junior Member
yeah but it takes 4 - 5 hours if i go for delete statement

is there a fast solution


the query am giving is

delete from history where ithist < (date)
Re: Table deletion [message #333694 is a reply to message #333693] Mon, 14 July 2008 03:20 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
And did you bother to click on any of the links provided?
Re: Table deletion [message #333695 is a reply to message #333680] Mon, 14 July 2008 03:24 Go to previous messageGo to next message
washer84
Messages: 5
Registered: July 2008
Location: India
Junior Member
of course i did dont be too rude to me..

i clicked in all those links
Re: Table deletion [message #333697 is a reply to message #333695] Mon, 14 July 2008 03:27 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

washer84 wrote on Mon, 14 July 2008 10:24
of course i
i clicked in all those links


Wow and you didnt find any advice you could take advantaged of..impressive
Re: Table deletion [message #333698 is a reply to message #333695] Mon, 14 July 2008 03:28 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
And they show you what you need to do, so what is your question? And exactly how was I being rude? I asked if you had looked at the links. I would suggest that you did not spoend much time looking at them (based on the elapsed time between the links being posted and your reply). I would further suggest that instead of just clicking on the links, you click on them and then read the contents of the pages that they take you to.
Re: Table deletion [message #333700 is a reply to message #333695] Mon, 14 July 2008 03:33 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
washer84 wrote on Mon, 14 July 2008 10:24
of course i did dont be too rude to me..

i clicked in all those links

And it took you only 12 minutes to read through all that, analyze what's said in those and visit back to see and answer pablolee's post.
Impressive.
Re: Table deletion [message #333701 is a reply to message #333689] Mon, 14 July 2008 03:35 Go to previous messageGo to next message
washer84
Messages: 5
Registered: July 2008
Location: India
Junior Member
pablolee wrote on Mon, 14 July 2008 11:08
Michel Cadot wrote on Mon, 14 July 2008 09:06
Did you try DELETE?


./fa/449/0/
Very droll Michel.



i was just answering to michel "Did you try DELETE?"

and am still reading those.. thanks for all your help..
Re: Table deletion [message #333703 is a reply to message #333701] Mon, 14 July 2008 03:37 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Washer, I didn't realise (my own fault) that you were replying to Michel's post rather than mine. Apologies. However, I still would say that Michel was not rude in any way.
Re: Table deletion [message #333706 is a reply to message #333703] Mon, 14 July 2008 03:45 Go to previous message
washer84
Messages: 5
Registered: July 2008
Location: India
Junior Member
no probs man.. we all are here to help each other..

cheers.. stay cool..
Previous Topic: Function Base Index with “INITIALLY DEFERRED” option
Next Topic: How to find duplicate rows.
Goto Forum:
  


Current Time: Wed Dec 07 04:42:00 CST 2016

Total time taken to generate the page: 0.06494 seconds