Concatenation issues

前端 未结 3 1057
后悔当初
后悔当初 2021-01-25 21:07

I have a table \"Patient\" which has 5 fields.

CREATE TABLE PATIENT
(PAT_ID         CHAR (4) PRIMARY KEY,
 PAT_NAME       VARCHAR (7),
 ADMITTED       DATE,
 ROO         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-25 22:08

    here is the query that creates view by name "view_name":

      create or replace view view_name as
    select t.Pat_Id || ' ' || t.Pat_Name Patient,
           t.Doctor,
           t.Room,
           to_char(t.Admitted, 'Month dd, yyyy') Admitted
      from Patient t 
    with read only;
    

    you can select as

    SELECT * FROM VIEW_NAME
    

    I think that here provided enough information, that you can add or manipulate (other) columns wether to show.

提交回复
热议问题