Woo hoo!  I figured this out!  I love Google!

For the benefit of others , here is what I did:

UPDATE EIM_CONTACT 
SET EIM_CONTACT.CONTACT_STATUS = EIM_CONTACT1.STATUS
FROM EIM_CONTACT  , EIM_CONTACT as EIM_CONTACT1
WHERE
EIM_CONTACT.ROW_ID = EIM_CONTACT1.CON_ID
AND EIM_CONTACT.PR_POSTN_ID = EIM_CONTACT1.POSTN_ID ;

SQL Server didn't like the INNER JOIN syntax for this or I just didn't
do it right. But this old way syntax worked.

Thanks for listening:)

- Frank




On Thu, 13 Jan 2005 19:07:17 -0500, Frank Mamone <[EMAIL PROTECTED]> wrote:
> I'm working on an ETL job at work and  I need to work with exported
> data which is denormaized and then re-import.  All data is in one
> table. Below is a simulated table for explanation purposes.
> 
> What I need to do is make the CON_STATUS field = STATUS if  CON_ID =
> ROW_ID AND POSTN_ID = PR_POS_ID for each row.
> 
> Is that possible using some kind of self join update syntax?
> 
> ROW_ID  POSTN_ID   CON_STATUS    CON_ID     PR_POS_ID      STATUS
> 1               20                                          10
>         30              ACTIVE
> 2               30                                          10
>          200             ACTIVE
> 3               40                                            1
>          60              ACTIVE
> 4               50                                            1
>          20              ACTIVE
> 5               60                                             7
>          40              ACTIVE
> 6               70                                            7
>          80              ACTIVE
> 7               80                                            9
>          30              ACTIVE
> 8               90                                            9
>          100             ACTIVE
> 9               100                                          4
>          200             ACTIVE
> 10              200                                          4
>         50               ACTIVE
> 
> Thanks for your help.
> 
> Frank
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:5:142462
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to