Specifying "MergeKeys" for "innerjoin"

조회 수: 11 (최근 30일)
FM
FM 2022년 11월 9일
댓글: FM 2022년 11월 18일
I wonder what people feel about incorporating a MergeKeys option into "innerjoin", similar to what is available for "outerjoin"?
The "innerjoin" function merges keys by default, but doesn't do so when specifying "LeftVariables" and "RightVariables". I want to use those options because my left and right tables have a lot of variables, and I only want a small subset to show up in the inner join. Hence, I have to write extra code that merges the keys, in effect, but anything I can do to keep the code volume down will reduce the cognitive noise.

채택된 답변

Lei Hou
Lei Hou 2022년 11월 18일
Hi,
Regarding the output of innerjoin, the key values from left table are the same as that from the right table. So, we only need to keep one copy. You can add key variable names to either "LeftVaribles" or "RightVariables" but not both.
Hoping this is helpful.
Thanks,
Lei
  댓글 수: 1
FM
FM 2022년 11월 18일
It does. Thanks, Lei.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by