List:General Discussion« Previous MessageNext Message »
From:Jerry Preeper Date:March 16 1999 7:39am
Subject:Re: (newbie ?) listing unique entries in two columns
View as plain text  
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?


>>I'm pretty new to mysql and I have a question about trying to list all the
>>unique entries from two different columns in the same table.  I have found
>>lots of examples on the mailing list archives of getting this info from one
>>column, but none for two.
>>Let's say I have a table with 10 columns and I want to list only the unique
>>entries that appear in the name_1 column and the name_2 column.  There are
>>about 50 different names that should appear in either column and I want to
>>make sure once in a while that I don't have any typos and I'm not missing
>>any data in calculating info off of these names in select statements.  The
>>names may be repeated a number of times in both columns in the table.
>>Ideally I'd like to set this up in a perl script as a cron job to run once
>>a month or something just to double check things.
>Do you mean each unique combination of values from the two columns?
>Won't "SELECT DISTINCT col1, col2 FROM ..." work?
>Paul DuBois, paul@stripped
>Northern League Chronicles:
>Madison Black Wolf:
(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