I have here a% w / o%, which apparently is simple if it were not for the fact that I have these query
ai, which I can not tell whether it is *
, inner join
or some other in the same family .
I need to convert this left join
to query
, and the result is not beating right. Does anyone help me to interpret this? I did linq to sql
and did not hit it right.
select AFENTIDADE.NOMEENTIDADE, NOMEAO, NOMEUTILIZADOR,
MN.DATACRIA, MN.DATAFECHO, MN.NUMFACT,
MN.NUMFOLHA, AESERVICO.TempoEI, HORASA, R.PRECOD
From AEMANUTE MN WITH (NOLOCK), AFENTIDADE WITH (NOLOCK), AREGDOC R WITH (NOLOCK),
UTILIZADORES WITH (NOLOCK), AESERVICO WITH (NOLOCK), AIAREAORGANICA WITH (NOLOCK)
Where (MN.CODENTIDADE=AFENTIDADE.CODENTIDADE
And MN.CODAO=AIAREAORGANICA.CODAO
AND MN.CODAO *=R.CODAO
And MN.numfolha=aeservico.numfolha
And MN.numfact *= R.numfact
And aeservico.codutilizador=utilizadores.codutilizador
AND UTILIZADORES.ANULADO IS NULL
AND
R.coddoc='FM') And
R.STATUS<>'E' And
MN.IdSituacao=5
--or MN.IdSituacao=5)
And
LEFT(MN.datafecho, 10) >='2017-04-01' And LEFT(MN.datafecho, 10) <='2017-04-30'
ORDER BY NOMEAO, NOMEUTILIZADOR, AFENTIDADE.NOMEENTIDADE