문제

Not extremely significant... but I've gotten a bit curious: What's the correct terminology for a self-join - do you join a table on itself, or join a table to itself?

도움이 되었습니까?

해결책

You join it to itself, on the fields being joined.

다른 팁

You're likely to get various answers since I'm not sure there's a "standard" per se, but I think SELF JOIN is pretty common, not to mention self-explanatory. And yes, you join it TO itself.

I would say you join a table to itself

I would only use on to refer to the fields being joined

I am gonna go all mavericky and say WITH. But, since JOIN is itself a verb, you do not need anything more than that:

TableA joins TableA
SELECT A.FIELD, B.FIELD
FROM MYTABLE A, MYTABLE B
WHERE A.PK = B.FK
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top