[thelist] sql de-doupe

r937 rudy at r937.com
Sat Feb 2 15:36:37 CST 2008

> I'm not sure if the min() function will work 
> as desired on the varchar field.

yes, it will

> I'd like to use a group by, but there's about 20 extra 
> fields besides those two in the query...

so go ahead and use GROUP BY, like this --

   SELECT model
        , MIN(cat) 
        , COUNT(foo)
        , AVG(bar)
        , ...  
     FROM daTable 
       BY model

but i already know what you're going to say next


More information about the thelist mailing list