我有 3 张桌子:
REPOTRANSSMISSION
TABLE 列是
REPO_TRANSMISSION_ID,
G3_SESSION_ID,
CLIENT_NM,
ASSESSMENT_SESSION_ID,
PACKAGE_SESSION_ID,
TEST_SESSION_ID,
SCORE_SESSION_ID,
REPO_TRANSMISSION_STATE_CD,
REPO_TRANSMISSION_DATA_TX,
REPO_TRANSMISSION_LEVEL_CD,
CREATE_DT,
LAST_MODIFIED_DT.
这里REPO_TRANSMISSION_ID
是主键, REPO_TRANSMISSION_STATE_CD
是外键
第二个表REPO_ TRANSSMISSION_REQ_LOG
列是
REPO_TRANSMISSION_REQ_LOG_ID
REPO_TRANSMISSION_ID
REQUEST_TX
RESPONSE_TX
ERROR_TX
CREATE_DT
LAST_MODIFIED_DT
这里PK_REPO_TRANSMISSION_REQ_LOG
是主键,REPO_TRANSMISSION_ID
是外键
第三个表REPO TRANSSMISSION STATE
列是
REPO_TRANSMISSION_STATE_CD
REPO_TRANSMISSION_STATE_DS
CREATE_DT
LAST_MODIFIED_DT
and
REPO_TRANSSMISSION_STATE_CD values are TRANS_RESP,
RECON_REQ,
RECON_ERR,
RECON_RETRY,
RECON_RESP
这PK_REPO_TRANSMISSION_STATE_cd
是主键
repo_transsmission_Id
当值高于 4 时,我必须检索它repotransmission_state_cd
,并且我必须加入第一个和第二个表。
我将如何编写 sql 查询?