* Armin > I've got two problem with mysql , maybe it is not a real > 'problem' but i need help hardly ! :) > > 1 > in a table , we got many record ( 1400 ) , some of them are > equal , i want to delete just one of them , in other word , i don't > want two record equal .
Take a look at SELECT DISTINCT and the GROUP BY clause. Both can be used to eliminate duplicates in a result. What you really need is to prevent the duplicates from showing up in the first place... you can do that by creating a UNIQUE index or a PRIMARY KEY. To create a new table without the duplicates: CREATE TABLE new_table SELECT DISTINCT * FROM old_table To add an index: ALTER TABLE new_table ADD UNIQUE (field1,field2,field3) <URL: http://www.mysql.com/doc/en/SELECT.html > <URL: http://www.mysql.com/doc/en/Selecting_columns.html#IDX397 > <URL: http://www.mysql.com/doc/en/GROUP-BY-Functions.html > <URL: http://www.mysql.com/doc/en/CREATE_TABLE.html > <URL: http://www.mysql.com/doc/en/ALTER_TABLE.html > > 2 > i got a text file , which must be into a table , text file syntax is > ' a,b,c ' and in table we got ' id,user,pass ' , how can i load > data from text into right place on table ? You can use the LOAD DATA statement or the mysqlimport utility: <URL: http://www.mysql.com/doc/en/LOAD_DATA.html > <URL: http://www.mysql.com/doc/en/mysqlimport.html > -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]