2

I have two tables "basket_products" and "products". I want to update "products" table's "adet" column with "basket_products" "adet" column. And i want to update rows where basket_products.urun = products.urun. I want to use this code and getting error : "The multi-part identifier "basket_products.urun" could not be bound."

update products
    set adet = adet - (
        select basket_products.adet
            from basket_products
                inner join products
               on products.urun = basket_products.urun) 
   where products.urun = basket_products.urun

What's wrong?

1
  • Thank you. ı could not find topic. Commented Dec 31, 2013 at 0:22

1 Answer 1

2

Try this:

update p set p.adet = bp.adet from products p join basket_products bp on p.urun = bp.urun

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.