|
 |
|
SQL สร้าง View จะสร้างขึ้นมาใหม่ทำไงบอกหน่อยครับ จะสร้าง วิว เอสคิวแอล ขึ้นมาใหม่ทำไงบอกหน่อยครับ |
|
 |
|
|
 |
 |
|
Code
CREATE OR REPLACE FORCE VIEW "D4LP"."V_T5_COURSE" ("ACADYEAR", "ATTENTIONCOUNT", "COURSECODE", "COURSEID", "COURSESTATUS", "STATUSNAMET", "STATUSNAMEE", "COURSETITLE", "CRE", "DEPTID", "FACID", "FINALEXAM", "FINISHDATE", "ISVISIBLE", "LANG", "LASTREGISTERDATE", "LOCATION", "MIDTERMEXAM", "ORGANIZER", "ORGANIZEREMAIL", "PINTYPE", "REQDATE", "REQPIN", "ROOM", "SEMESTER", "STARTDATE", "TOTALPOINT", "DEPTNAMEE", "DEPTNAMET", "FACNAMEE", "FACNAMET", "STUCOUNT") AS
SELECT
-- Created by Phichit -----
T5_COURSE.ACADYEAR,
T5_COURSE.ATTENTIONCOUNT,
T5_COURSE.COURSECODE,
T5_COURSE.COURSEID,
T5_COURSE.COURSESTATUS,
T5_ALLVARS.VALUET AS STATUSNAMET,
T5_ALLVARS.VALUEE AS STATUSNAMEE,
T5_COURSE.COURSETITLE,
T5_COURSE.CRE,
T5_COURSE.DEPTID,
T5_COURSE.FACID,
T5_COURSE.FINALEXAM,
TO_CHAR(T5_COURSE.FINISHDATE, 'YYYY-MM-DD HH24:MI:SS'),
T5_COURSE.ISVISIBLE,
T5_COURSE.LANG,
TO_CHAR(T5_COURSE.LASTREGISTERDATE, 'YYYY-MM-DD HH24:MI:SS'),
T5_COURSE.LOCATION,
T5_COURSE.MIDTERMEXAM,
T5_COURSE.ORGANIZER,
T5_COURSE.ORGANIZEREMAIL,
T5_COURSE.PINTYPE,
TO_CHAR(T5_COURSE.REQDATE, 'YYYY-MM-DD HH24:MI:SS'),
T5_COURSE.REQPIN,
T5_COURSE.ROOM,
T5_COURSE.SEMESTER,
TO_CHAR(T5_COURSE.STARTDATE, 'YYYY-MM-DD HH24:MI:SS'),
T5_COURSE.TOTALPOINT,
T5_DEPARTMENT.DEPTNAMEE,
T5_DEPARTMENT.DEPTNAMET,
T5_FACULTY.FACNAMEE,
T5_FACULTY.FACNAMET,
V_T5_ENROLL_COUNT.STUCOUNT <---------- ตัวนี้
FROM T5_COURSE LEFT JOIN T5_FACULTY ON T5_COURSE.FACID=T5_FACULTY.FACID
LEFT JOIN T5_DEPARTMENT ON T5_COURSE.FACID=T5_DEPARTMENT.FACID AND T5_COURSE.DEPTID=T5_DEPARTMENT.DEPTID
LEFT JOIN V_T5_ENROLL_COUNT ON T5_COURSE.COURSEID=V_T5_ENROLL_COUNT.COURSEID
LEFT JOIN T5_ALLVARS ON T5_COURSE.COURSESTATUS=T5_ALLVARS.FIELDCODE AND T5_ALLVARS.TABLENAME='t5_course' AND T5_ALLVARS.FIELDNAME='CourseStatus' WITH READ ONLY;
จะสร้างขึ้นมาใหม่ทำไงบอกหน่อยครบั
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-05-04 15:50:07 |
By :
evening |
View :
1305 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2009-05-04 16:30:40 |
By :
rasabut |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าต้องการแก้ไข ก็ต้อง Alter View ครับ
หรือต้องการสร้างใหม่เลย
ก็ต้อง Drop view ก่อน
แล้วค่อย Create View ขึ้นมาครับ
|
 |
 |
 |
 |
Date :
2009-05-04 16:57:31 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2009-05-05 17:24:26 |
By :
kanowan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2009-05-05 17:24:38 |
By :
kanowan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|