web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX Select statement Joins

(0) ShareShare
ReportReport
Posted on by 2,903

Hi All,

Can anybody provide me a clear picture of joins used in X++ code.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Syed Zeeshan Haider Jafry Profile Picture
    725 on at
    RE: AX Select statement Joins

    Hi,

    The joins are explained in the blow post,

    axzaptech.wordpress.com/.../playing-with-data

  • Suggested answer
    Tommy Skaue Profile Picture
    Moderator on at
    RE: AX Select statement Joins

    Often when I think of queries and joins I find it easier to think about two dimensional tables, rows and columns, and how you can take two resultsets and join them together into a bigger resultset, from which you pick what columns to work on in the ending resultset.

    So when you join two results, you provide the link between them, the criteria on how you link the two together. Either you have a single unique key, or a "key" based on a set of different columns.

    When you join two results, you can either say you only want to have rows where there is a match on both results. This is called "inner join". Or you can say you always wants the row from one the resultsets and whatever is found in the joined resultset (left or right join in SQL).

    You can then take the above and chain joins, but it is always a two-by-two join finally resulting in a result resultset.

    Now, as for X++ we are sort of limited compared to SQL, because there are no left join, right join or inner join. All joins are left and inner by default. You do have the "outer" keyword if needed.

    Here is a comparisson between SQL and X++ in regards of queries:

    msdn.microsoft.com/.../dd261457.aspx

    Here is how to use the outer join:

    msdn.microsoft.com/.../gg845763.aspx

    So basically X++ is simpler and more implicit for querying. This may pose a challenge in some scenarious, but I've always been able to design my way around those limitations.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans