SQL help

So we've decided to replace three of our existing attribute values with the contact restrictions on the general tab, which we currently aren't using.  Before I get rid of those values I'd like to run an update statement to insert the restriction for those accounts that currently have the attribute.  A SQL whiz I am not.  So I'm able to update the value for one account, but how do I do it for a list of accounts?!  I tried using commas to separate the account numbers, which didn't work.  I'm trying this in test first of course.

Help!

Parents
  • Christina,

     

    This is pseudo code so unfortunately, no cut and paste.  But the general idea is to look in tx_cust_keyword for those people with the attribute and the update all those rows in t_customer with a value.  So....

     

    update t_customer

    set phone_ind = <some value>

    where customer_no in (select distinct customer_no from tx_cust_keyword where keyword_no = <attribute id> and key_value = <some other value>

     

    There are certainly other ways of doing this and hopefully you will get a couple of different ideas from others.

Reply
  • Christina,

     

    This is pseudo code so unfortunately, no cut and paste.  But the general idea is to look in tx_cust_keyword for those people with the attribute and the update all those rows in t_customer with a value.  So....

     

    update t_customer

    set phone_ind = <some value>

    where customer_no in (select distinct customer_no from tx_cust_keyword where keyword_no = <attribute id> and key_value = <some other value>

     

    There are certainly other ways of doing this and hopefully you will get a couple of different ideas from others.

Children
No Data