Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

if statement within SELECT?

256277Apr 11 2002
Howdy..trying to create a new column for viewing only...new column is a percentage of another column...but if the divisor column is zero, I want the value to be 1. basically:

IF A.PRICE_VNDR = 1 then NEW COLUMN = (((A.PRICE_VNDR)-(B.PRICE_VNDR))/(A.PRICE_VNDR)*100)
IF A.PRICE_VNDR = 1 then NEW COLUMN = 1

can I do this with SQL? I am creating it via PeopleSoft query, but I should be able to use regular Oracle SQL. My second thought was to create a view and 'store' the new column there.

Thanks!!! Please respond to timmbuck2@yahoo.com

Timm
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2002
Added on Apr 11 2002
1 comment
219 views