2
Gentlemen, I have a table where I want to bring the column when the value is null but when it is filled it should not be displayed, as I can implement this condition in SQL ?
SELECT
OBS.NUOBS,
OBS.DTOBS,
OBS.CODUSU,
OBS.OBS,
OBS.PENDENTELOG,
OBS.DTHSOBS,
OBS.REGINC,
OBS.DHPROXCONTATO,
OBS.ID,
OBS.FIMATT
FROM AD_PRONTUARIOOBS OBS
LEFT JOIN AD_PRONTUARIOATT ATT (NOLOCK) ON ATT.PEDIDOEXTERNO = OBS.PEDIDOEXTERNO
Today I am developing the above query, column B would refer to table AD_PRONTUARIOATT
For me to answer with an example in your table, tell me which field of the table
AD_PRONTUARIOOBS
, that if it isNULL
, has to bring what field ofAD_PRONTUARIOATT
?– rbz
@Rbz field OBS.FIMATT.
– Gabriel Paixão Justino
OBS.FIMATT
ofAD_PRONTUARIOOBS
... But what about theAD_PRONTUARIOATT
?– rbz
@Rbz the field only exists in the table AD_PRONTUARIOOBS even, I ended up missing the question, the field is only of this table.
– Gabriel Paixão Justino
If
OBS.FIMATT
forNULL
, then you have nothing to bring from the other referenced table? kkk– rbz
So when this field is filled it should be displayed on the screen, when null should not be displayed, I just put the field there to show you what it was, in the other table I will only bring the external request that I have not yet entered...
– Gabriel Paixão Justino