MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 8th, 2013, 05:21 PM
lexierowsell lexierowsell is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 lexierowsell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 10 sec
Reputation Power: 0
Deleting a range of rows from a table

Hi all, I could not find this answer in my searches, I apologize if it has been answered previously.

I am very new to SQL. I am looking for a query to delete a range of rows from a single table. There are MANY rows (200k+ ), and the solutions I have found are all for one row at a time like below:

DELETE FROM post
WHERE postid=237910


DELETE FROM post
WHERE postid=237911


DELETE FROM post
WHERE postid=237912


all the way to:


DELETE FROM post
WHERE postid=470433


Ideas? Better methodologies?

TYIA!

Reply With Quote
  #2  
Old January 8th, 2013, 05:28 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,356 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 4 h 30 m 28 sec
Reputation Power: 4140
Quote:
Originally Posted by lexierowsell
...the solutions I have found are all for one row at a time
let me guess, you never got past the w3schools tutorial

Code:
DELETE 
  FROM post
 WHERE postid BETWEEN 237910 AND 470433
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #3  
Old January 8th, 2013, 05:30 PM
lexierowsell lexierowsell is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 lexierowsell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 10 sec
Reputation Power: 0
Thank you, much appreciated.

I got a few different answers from google, but I didnt find this.

Thanks again, and apologies for being a twit.

Reply With Quote
  #4  
Old January 8th, 2013, 06:26 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,356 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 4 h 30 m 28 sec
Reputation Power: 4140
Quote:
Originally Posted by lexierowsell
Thanks again, and apologies for being a twit.
you're welcome, and there is certainly no need to apologize

you should see some of the sql i tried when i was just starting out

Reply With Quote
  #5  
Old January 18th, 2013, 01:02 PM
lexierowsell lexierowsell is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 6 lexierowsell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 10 sec
Reputation Power: 0
I wish I could! I would love to have someone to learn from. I'm pretty sure I have jumped into the deep end my first round...

Can always count on a fellow Canadian to lend a hand! (I'm a Bluenoser, Nova Scotia through and through, though currently displaced in Texas...)

Reply With Quote
  #6  
Old January 18th, 2013, 02:45 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,356 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 4 h 30 m 28 sec
Reputation Power: 4140
Quote:
Originally Posted by lexierowsell
Can always count on a fellow Canadian to lend a hand!
that's fer sure, y'all

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Deleting a range of rows from a table

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap