Forum Discussion
Update query
Hello community!
I need to update the field price of a table with this condition:
to all type C items, increase the value of the price of type A items by 65%.
That is to say:
Item - Price - Type
Item1 - 10 - A
Item2 - 15 - A
Item1 - 12 - B
Item2 - 20 - B
Item1 - (10 + (10+ (10+65%)) - C
Item2 - (15 + (15+(15+65%)) - C
What is the correct SQL statement to be able to perform this table record update?
Thanks and Happy New Year!
- olafhelperBronze Contributor
to all type C items, !
RaulSG ; what for C items, I don't see one?
Please post table design as DDL, some sample data as DML statement and the expected result.
- RaulSGBrass Contributor
olafhelper Sorry,
From:
Item - Price - Type
Item1 - 10 - A
Item2 - 15 - A
Item1 - 12 - B
Item2 - 20 - B
Item1 - 1 - C
Item2 - 1 - CTo:
Item - Price - Type
Item1 - 10 - A
Item2 - 15 - A
Item1 - 12 - B
Item2 - 20 - B
Item1 - (10+ (10*65%)) - C
Item2 - (15+(15*65%)) - C- olafhelperBronze ContributorAnd which role does Type = "B" play; none?
Again, p0lease post table design as DDL, some sample data as DML statement and the expected result.