Home » SQL & PL/SQL » SQL & PL/SQL » Default Values !!!!!!!! Urgent
Default Values !!!!!!!! Urgent [message #19323] Tue, 12 March 2002 00:25 Go to next message
Rm69
Messages: 39
Registered: January 2002
Member
l want to have a condition that gives me a value zero in my scripts so that if the institution is not african bank then my value in the total should be zero so that when l subtract the CAPITAL-SUM(TOTAL)) l get the Capital.

CREATE TABLE TABLE_BSP
AS
SELECT
DISTINCT(DEALREF),pw38600p.lof386 loanOff,pw38600p.bro386 Brokercd,CAPITAL,(CAPITAL-SUM(TOTAL)) TOTAL,
COUNT(TOTAL) LOAN_COUNT
FROM MIS_PERSAL,pw38600p
WHERE INSTITUTION LIKE '%AFRICAN BANK%' and dealref=pw38600p.dea386
GROUP BY DEALREF,CAPITAL,lof386,bro386

--Use to extract hmcs
CREATE TABLE TABLE_HMC
AS
SELECT
DISTINCT(DEALREF),pw38600p.lof386 loanOff,pw38600p.bro386 Brokercd,CAPITAL,(CAPITAL-SUM(TOTAL)) TOTAL,COUNT(TOTAL) LOAN_COUNT
FROM MIS_PERSAL,pw38600p
WHERE INSTITUTION LIKE '%AFRICAN BANK%' AND brocker = 'HMC' AND
dealref=pw38600p.dea386
GROUP BY DEALREF,CAPITAL,lof386,bro386
Re: Default Values !!!!!!!! Urgent [message #19342 is a reply to message #19323] Tue, 12 March 2002 10:53 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
It's difficult to understand your requirement. have you tried NVL() function?
Previous Topic: Date Convert
Next Topic: Joining on Nonmatched Key
Goto Forum:
  


Current Time: Fri Apr 19 17:11:26 CDT 2024