I am trying to update 2 columns in a table using the update command and I have to use if statement. Table:
SQL> create table report(customer_no number primary key, name varchar2(10) not null, current_meter_reading number not null, previous_meter_reading number not null, category_code number not null, units_consumed number, bill_amount number(5,2), remarks varchar2(20));
For the bill_amount and remarks I need to use if statement, condition:
IF Category code = 1 Bill amount = Units consumed * 0.90, REMARKS = “DOMESTIC”
IF Category code = 2 Bill amount = Units consumed * 2.40, REMARKS = “COMMERCIAL”
IF Category code = 3 Bill amount = Units consumed * 0.50, REMARKS = “FARMERS”
The final output should look like this:Output