I need to mount a VIEW with three fields, but one depends on the other to be calculated (two of them are from the same table in different lines I need to "link" them), how do I add those fields in one place? The select's are as follows:
SELECT Referencia FROM ZSF053 WHERE TpFat = 'ZREK'
SELECT Doc_orig FROM ZFI003 WHERE Referencia = (utiliza as referencias do select acima)
SELECT Referencia FROM ZFI003 WHERE Num_doc = (utiliza os Doc_orig do select acima)