我知道,这个问题的标题可能没有什么不准确之处,但我可以说得更好。 职业介绍。
I have to fetch 2 different fields, one is always there, the other isn t. That means I m looking at a LEFT JOIN. Good so far.
但是,我所希望的行文是而不是,其存在不确定。
我想做的是:
<<>strong> 和picture,但只有 > 姓名有picture_id。 否则,就没有显示任何情况,但我仍然想要知道这些名字,不管他们是否加入。
我知道,这可能是一个小的混淆,但这里有一些cl,因此,我猜想一些人会理解这一点。
我尝试了一些办法,但我只想说一下我想要的。
P.S.: Solutions specified to Oracles are also well.
www.un.org/spanish/ecosoc
EDIT I ve tried some queries but the main problem I found is that, inside the ON clause, I am only able to reference the last table mentioned, in other words: There are four tables from which I m retrieving data, but I can only mention the last (third table) inside the on clause of the LEFT JOIN(which is the 4th table). I ll describe the tables hopefully that ll help. Try not to delve too much on the names, because they are in Portuguese:
表4 我想检索的领域是:。 TB395.dsclaudo
and TB397.dscrecomendacao
, for a given TB392.nron
。 表格如下:
TB392(laudoid,nronip,codlaudo)
// laudoid is PK, references TB395
TB395(codlaudo,dsclaudo>> PK
TB398(laud Bot,codrecomendacao)
/the pair laudvil,codrecomendacao is PK, reference TB397
TB397(codrecomendacao,dscrecomendacao)
/ codrecomendacao is PK
名称相同的领域是外国钥匙。
The problem is that there s no guarantee that, for a given laudoid
,there will be one codrecomendacao
. But, if there is, I want the dscrecomendacao
field returned, that s what I don t know how to do. But even if there isn t a corresponding codrecomendacao
for the laudoid
, I still want the dsclaudo
field, that s why I think a LEFT JOIN applies.