添加乘法连接
Adding a Multiplies joins
如何添加乘法连接。
您需要将其添加为 left join
,因为条件是现有 left join
中的第二个 table。所以这个 FROM
子句应该有效:
FROM tbl_agen_sala_hora thLEFT JOIN
tbl_agen_sala ts
ON th.des_hora_inil = ts.des_hora_inil AND
th.des_hora_finl = ts.des_hora_finl AND
ts.des_dia = @p_des_dia AND
ts.des_mes = @p_des_mes AND
ts.des_ano = @p_des_ano AND
((ts.num_sala = @p_num_sala) OR (@p_num_sala = 0)) AND
ts.num_sala = @p_num_sala LEFT JOIN
TBL_INTR_USUA tu
ON tu.des_logi = ts.des_logi_manu LEFT JOIN
tbl_agen_sala_sala ss
ON ts.num_sala = ss.num_sala
如何添加乘法连接。
您需要将其添加为 left join
,因为条件是现有 left join
中的第二个 table。所以这个 FROM
子句应该有效:
FROM tbl_agen_sala_hora thLEFT JOIN
tbl_agen_sala ts
ON th.des_hora_inil = ts.des_hora_inil AND
th.des_hora_finl = ts.des_hora_finl AND
ts.des_dia = @p_des_dia AND
ts.des_mes = @p_des_mes AND
ts.des_ano = @p_des_ano AND
((ts.num_sala = @p_num_sala) OR (@p_num_sala = 0)) AND
ts.num_sala = @p_num_sala LEFT JOIN
TBL_INTR_USUA tu
ON tu.des_logi = ts.des_logi_manu LEFT JOIN
tbl_agen_sala_sala ss
ON ts.num_sala = ss.num_sala