2017-08-21 74 views
1

改變的值,我從我的數據庫及其狀態= 0,我出口到必須有自己的地位= 1的系統中提取的學生。我可以得到查詢拉狀態,但我不知道如何將其更改爲1,出口到其他系統?SQL出口

在此先感謝!

select STUDENTS.FIRST_NAME as "firstname", 
    STUDENTS.LAST_NAME as "lastname", 
    STUDENTS.STUDENT_NUMBER as "idNumber", 
    STUDENTS.ENROLL_STATUS as "status", 
    STUDENTS.SCHOOLID as "school", 
    STUDENTS.CLASSOF as "gradyear", 
    U_DEF_EXT_STUDENTS.GSUITEEMAILADDRESS as "email" 
from U_DEF_EXT_STUDENTS U_DEF_EXT_STUDENTS, 
    STUDENTS STUDENTS 
where U_DEF_EXT_STUDENTS.STUDENTSDCID=STUDENTS.DCID 
     and STUDENTS.SCHOOLID =1992 
     and STUDENTS.ENROLL_STATUS =0 

回答

0

您可以指定1到狀態

SELECT STUDENTS.FIRST_NAME as "firstname", 
     STUDENTS.LAST_NAME as "lastname", 
     STUDENTS.STUDENT_NUMBER as "idNumber", 
     1 as "status", -- assign 1 to status 
     STUDENTS.SCHOOLID as "school", 
     STUDENTS.CLASSOF as "gradyear", 
     U_DEF_EXT_STUDENTS.GSUITEEMAILADDRESS as "email" 
    FROM U_DEF_EXT_STUDENTS U_DEF_EXT_STUDENTS 
INNER JOIN STUDENTS STUDENTS 
    ON U_DEF_EXT_STUDENTS.STUDENTSDCID = STUDENTS.DCID 
WHERE STUDENTS.SCHOOLID = 1992 
    AND STUDENTS.ENROLL_STATUS = 0