Home > database >  Create a view in the oracle
Create a view in the oracle

Time:09-24

In oracle creates a view VreportSettleAccount, contains field: time, charge to an account person of charge to an account number, online lending (quantity), offline loan (number), total online account + online account ()
Data source VREPAYRECEIPT
VREPAYRECEIPT views include loan way field, when the value is 1: online lending, the value of 2: offline lending, the rest of the field are in VREPAYRECEIPT access

CodePudding user response:

 
- use a decode functionThe create or replace the view VreportSettleAccount
As
Select an account time, person of charge to an account number, online lending,
Decode (loan way, 1, 'online lending, 2,' offline loan) loan way
The from VREPAYRECEIPT

CodePudding user response:

 CREATE OR REPLACE the VIEW VreportSettleAccount 
AS
SELECT an account time,
The person of charge to an account number,
Online lending (quantity),
Offline loan (quantity),
The sum (online loan + offline loan),
Decode (loan way, 1, 'online lending, 2,' offline loan) loan way
The FROM VREPAYRECEIPT;

CodePudding user response:

 create or replace the view v_name 
As
Select billing time, person of charge to an account number, online lending (quantity), offline loan (quantity), decode (loan way, 1, line, 2, offline), sum (online loan + online loan) from
VREPAYRECEIPT

CodePudding user response:

Can use the NVL function selection

CodePudding user response:

 \ 
The CREATE OR REPLACE the VIEW Account
AS
The SELECT JZSJ
Jzr_id, XSFD XXFD,
The sum (XSFD + XXFD),
Decode (FFKFS, 1, 'XSFD', 2, 'XXFD) FFKFS
The FROM VREPAYRECEIPT;

CodePudding user response:

 CREATE VIEWVreportSettleAccount 
AS
SELECT an account time, person of charge to an account number, online lending,
DECODE (loan way, 1, 'online lending, 2,' offline loan) loan way
The FROM VREPAYRECEIPT

CodePudding user response:

 CREATE VIEW VreportSettleAccount 
AS
SELECT an account time, person of charge to an account number, online lending,
DECODE (loan way, 1, 'online lending, 2,' offline loan) loan way
The FROM VREPAYRECEIPT

CodePudding user response:

REATE OR REPLACE the VIEW VreportSettleAccount
AS
SELECT an account time,
The person of charge to an account number,
Online lending (quantity),
Offline loan (quantity),
The sum (online loan + offline loan),
Decode (loan way, 1, 'online lending, 2,' offline loan) loan way
The FROM VREPAYRECEIPT;
  • Related