In the query below, the condition
and r.master_seq=206
is used on the on clause as a join condition.
In the programme code, the value for r.master_seq is set by a parameter.
My concern is that I'm not sure if it's ok to mix in this condition(r=.master_seq=123, that I believe should be a where condition) into the join condition.
I was thinking that I should only use relational information(primary keys and foreign keys) in the join clause, not a where condition ( where id=123, balance>300, etc).
SELECT
*
FROM
TB_REQUEST_DATA D
left outer join
TB_SPOT_REPORT_REQUEST r
on D.SEQ = r.REQUEST_SEQ
and r.master_seq=206
WHERE
d.SEQ IN (
7,12,5,11,4
)
desc tb_request_data;
Name Null Type
------------- -------- -------------
SEQ NOT NULL NUMBER
REQUEST_NM NOT NULL VARCHAR2(50)
REG_DT NOT NULL DATE
REG_ID NOT NULL VARCHAR2(20)
UP_DT NOT NULL DATE
UP_ID NOT NULL VARCHAR2(20)
DISASTER_TYPE VARCHAR2(500)
desc TB_SPOT_REPORT_REQUEST;
Name Null Type
------------ -------- -------------
MASTER_SEQ NOT NULL NUMBER
SEQ NOT NULL NUMBER
REQUEST_SEQ NOT NULL NUMBER
REAL_FILE_NM VARCHAR2(100)
DOWN_FILE_NM VARCHAR2(100)