If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MYSQL multiple records

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-11-04, 12:20
BonomanX BonomanX is offline
Registered User
 
Join Date: Apr 2004
Location: .
Posts: 1
MYSQL multiple records

Hi, could someone help me with multiple records?
I have some table with multiple records, want to delete multiple records from this table by having unique records stay again in it.
I need to do it by using a SQL query, NOT a PHP or other language script.
I know the keyword distinct in MySQL, but it returns me back only this unique records, but i need to show the other part of records.
Thanks for answer. Bonoman.
Reply With Quote
  #2 (permalink)  
Old 04-11-04, 13:37
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
So you have a table that has rows that have duplicate values in some columns, but different values in other columns? If that is the case, you need to decide which of the rows you want to keep, and the syntax needed to isolate either the rows you want to either keep or delete.

Once you've got that figured out, you should be able to put them together to create a DELETE statement that will do just what you want!

Just FYI, this sounds suspiciously like an assignment. You probably want to talk this out in person with somebody in the lab sessions rather than just ask for a solution on the internet.

-PatP
Reply With Quote
  #3 (permalink)  
Old 04-13-04, 04:58
omiossec omiossec is offline
Registered User
 
Join Date: Jan 2003
Location: Paris, France
Posts: 320
You can create a temporary table
Export all distinct row in this table
Delete data in your main table and re import data from the temporary table
__________________
Olivier Miossec
--
http://www.lasso-developpeur.net/
--
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On