3 Replies - 9139 Views - Last Post: 27 June 2006 - 03:39 AM

#1 JavaWannaBe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-March 06

Oracle sql query involving update with math operation

Posted 18 June 2006 - 05:36 AM

I am increase by 10% the price of all products located in Dallas.

I tried

SQL> update products set price = 1.1*price where city='dallas';

0 rows updated.



What am I doing wrong?

Thank you
Is This A Good Question/Topic? 0
  • +

Replies To: Oracle sql query involving update with math operation

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Oracle sql query involving update with math operation

Posted 18 June 2006 - 07:13 AM

Sorry, but I gotta start with the basics...do you have any rows where the field city holds the value of 'dallas'? Becasue if this is related to your table from the other post, all the values are written like 'Dallas'.
Was This Post Helpful? 0
  • +
  • -

#3 JavaWannaBe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 23-March 06

Re: Oracle sql query involving update with math operation

Posted 18 June 2006 - 08:03 AM

View PostAmadeus, on 18 Jun, 2006 - 06:05 AM, said:

Sorry, but I gotta start with the basics...do you have any rows where the field city holds the value of 'dallas'? Becasue if this is related to your table from the other post, all the values are written like 'Dallas'.




Thank you, I had just figured that was my problem. I was leaving it uncapped.
Was This Post Helpful? 0
  • +
  • -

#4 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Oracle sql query involving update with math operation

Posted 27 June 2006 - 03:39 AM

To be safe, you can do this?:
SQL> update products set price = 1.1*price where LOWER(city)='dallas';



That way, irrespective of the case, as long as its Dallas the query will work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1