using UPDATE with GROUP By

Ivan Smahin ivan_smahin at paradigmasoft.com
Tue Jun 22 02:18:23 CDT 2010


Hello william,

Monday, June 21, 2010, 7:35:49 PM, you wrote:

> Yes that is exactly one of the groups I wish to update.

It should be something like this:

UPDATE
        data_address 
SET 
        d_address_LineNumber = 2 
WHERE
        RecID IN (
                                select
                                        rec
                                FROM
                                (select 
                                                t1.RecID as rec,
                                                t1.d_address_LineNumber,
                                                count(t1.RecID) as s
                                FROM
                                        data_address t1,
                                        data_address t2
                                where
                                  t1.d_address_clients_ref = t2.d_address_clients_ref
                                group by
                                 t1.RecID,
                                 t1.d_address_LineNumber
                                 having s = 2   
                                 )
                        )


  Check it please carefully.


-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list