SELECT
UserId,
FirstName,
MiddleName,
LastName,
Gender,
Email,
Student,
Password,
Major,
Ethnicity,
Class,
Academic_Program,
LTI_User_ID,
SSO_UID,
Act1,
Act2,
Act3,
Act4,
ActCom,
Satv,
Satm,
SatSum
FROM (SELECT DISTINCT SPRIDEN_PIDM AS UserID,
SPRIDEN_FIRST_NAME AS FirstName,
SPRIDEN_MI AS MiddleName,
SPRIDEN_LAST_NAME AS LastName,
SPBPERS_SEX AS Gender,
HUSTUDENT.CK_EMAIL (SPRIDEN_PIDM) AS Email,
'student' AS Student,
'password' AS Password,
SGBSTDN_MAJR_CODE_1 AS Major,
SPBPERS_ETHN_CDE AS Ethnicity,
F_CLASS_CALC_FNC (A.SGBSTDN_PIDM,
A.SGBSTDN_LEVL_CODE,
SFRSTCR_TERM_CODE) AS Class,
'ACADEMICPROGRAM' AS Academic_Program,
'LTIUSERID' AS LTI_User_ID,
'SSOUID' AS SSO_UID,
SCHEV.CK_ACT1 (SPRIDEN_PIDM) AS Act1,
SCHEV.CK_ACT2 (SPRIDEN_PIDM) AS Act2,
SCHEV.CK_ACT3 (SPRIDEN_PIDM) AS Act3,
SCHEV.CK_ACT4 (SPRIDEN_PIDM) AS Act4,
SCHEV.CK_ACT5 (SPRIDEN_PIDM) AS ActCom,
SCHEV.CK_SATV1 (SPRIDEN_PIDM) AS Satv,
SCHEV.CK_SATM1 (SPRIDEN_PIDM) AS Satm,
SCHEV.CK_SATV1 (SPRIDEN_PIDM) + SCHEV.CK_SATM1 (K.SORTEST_PIDM) AS SatSum
FROM SPRIDEN,
SPBPERS,
SGBSTDN,
SFRSTCR
WHERE
AND SPRIDEN_CHANGE_IND IS NULL
AND SPRIDEN_PIDM = SPBPERS_PIDM
AND SPRIDEN_PIDM = SGBSTDN_PIDM
AND SPRIDEN_PIDM = SFRSTCR_PIDM
AND SFRSTCR_TERM_CODE = :TERM
AND :Button_Run_query IS NOT NULL)
ORDER BY SPRIDEN_LAST_NAME, SPRIDEN_FIRST_NAME
我发现了一些东西,直到我把上面的代码放在notepad++中。当我拆分它时,我看到我有WHERE AND,所以我修复了它,然后我还必须将顺序更改为LastName和FirstName,而不是文件中的实际名称。