sql - C# Access Database Question -


say have 2 tables now, priceplan , bill. both tables have column called 'price' , table 'bill' update value 'priceplan's price. how can or sql statement should using? in advance!

you need have sort of way define relationship between 2 tables.

for instance if tables have structure:

priceplan --------- id price  bill --------- priceplanid price 

this work sql server. see below access solution.

then query should update bill :

update b set b.price = pp.price bill b inner join priceplan pp on b.priceplanid = pp.id 

also, schema above example purposes. if yours should @ changing it.

update

i noticed access, sorry. strucure of query different. see below:

update bill inner join  priceplan on bill.priceplanid = priceplan.id set bill.price= [priceplan].[price]; 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -