List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:March 16 1999 6:10pm
Subject:Re: (newbie ?) listing unique entries in two columns
View as plain text  
Jerry Preeper wrote:
> 
> Not each unique combination, but each unique entry - let's say name_1 had
> 50 unique entries and name_2 had 51 unique entries, the 50 in name_1 plus a
> misspelling of ssally.
> 
> I would be trying to find the misspelling or other names and such.  I
> wonder if another way to accomplish this would be to create another table
> with the allowable names and then display the non-matching records in the
> main table with a select statement, but now I'm lost again.
> 
> I tried :
> 
> select * from results_table where name_1 or name_2 not = names_table.names
> into outfile /tmp/badnames.txt;
> 
> which I hoped would give me a list of all the records with non-matching
> names but I get ERROR 1064: parse error near '= names_table.names into
> outfile /tmp/badnames.txt' at line 1
> 
> Any thoughts?
> 
> Jerry
< cut > 

Hi Jerry

Perhaps you should get a SQL book first :)

The above SELECT should be:
SELECT 
	* 
INTO OUTFILE 
	'/tmp/badnames.txt' 
FROM 
	results_table
	, names_table 
WHERE 
	results_table.name_1 <> names_table.names
	OR results_table.name_2 <> names_table.names

The above conctenation of tables is called 'JOIN' (if you want to read about it e.g. in
the manual)

Tschau
Christian

Thread
(newbie ?) listing unique entries in two columnsJerry Preeper16 Mar
  • Re: (newbie ?) listing unique entries in two columnsChristian Mack16 Mar
Re: (newbie ?) listing unique entries in two columnsJerry Preeper16 Mar