List:General Discussion« Previous MessageNext Message »
From:SGreen Date:August 16 2004 3:36pm
Subject:Re: SQL question, SELECT DISTINCT
View as plain text  
It all depends on which values of f1 you want to ignore.

f1      f2     f3
-----   -----  ------
val1-1  val2   val3
val1-2  val2   val3
val1-3  val2   val3

Which value of f1 would you want in your new table? Which ones to ignore? 
Are there other columns (beyond these 3) to move as well?

Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

"leegold" <leegold@stripped> wrote on 08/16/2004 11:29:33 AM:

> say I'm selecting distinct (non-duplicate) rows for insertion,
> 
> insert into original_table select distinct * from new_table
> 
> these tables have 3  fields/row. Per the above code all 3 fields are 
> evaluated by "distict *" .
> 
> But my question is: I want to ignore field1, therefore I only want to 
> test if any rows have field2 *and* field3 as dups - that would be my 
> distinct test and then do the insert based on that. Test f2 and f3, not
> f1.
> 
> What the sql? Help is greatly appreciated.
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> 

Thread
Can connect with PHP to MYSQLleegold13 Aug
  • Re: Can connect with PHP to MYSQLsuomi13 Aug
  • Re: Can connect with PHP to MYSQLWesley Furgiuele13 Aug
    • Re: Can connect with PHP to MYSQLleegold13 Aug
      • Re: Can connect with PHP to MYSQLAndreas Ahlenstorf13 Aug
        • SQL question, SELECT DISTINCTleegold16 Aug
          • Re: SQL question, SELECT DISTINCTSGreen16 Aug
            • Re: SQL question, SELECT DISTINCTleegold16 Aug
              • T-SQL SUM() Overflow?David Mohorn16 Aug
              • Re: SQL question, SELECT DISTINCTSGreen16 Aug
                • Re: SQL question, SELECT DISTINCTleegold16 Aug
                  • Re: SQL question, SELECT DISTINCTMichael Stassen16 Aug
RE: T-SQL SUM() Overflow?Martin Gainty16 Aug
Re: SQL question, SELECT DISTINCTleegold16 Aug
  • Re: SQL question, SELECT DISTINCTMichael Stassen16 Aug
    • Re: SQL question, SELECT DISTINCTleegold16 Aug
Re: SQL question, SELECT DISTINCTleegold16 Aug
Re: SQL question, SELECT DISTINCTStephen E. Bacher17 Aug
  • Re: SQL question, SELECT DISTINCTMichael Stassen17 Aug