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)

join tables in X++

(0) ShareShare
ReportReport
Posted on by

Hi , 

i have Table "A" and  i  need to join Table "B" and Table "C" to Table "A"

EX:

while select X from A where A.ID == '5'

Join B where A.BID==B.ID

join C where A.CID==C.ID

any help to make right join between three tables

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at
    RE: join tables in X++

    you can check this link

    community.dynamics.com/.../how-joins-in-x-select-statement-are-translated-into-t-sql

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: join tables in X++

    Hi,

    Code whatever you are using seems to be fine, are you looking for sql statement for the same.

    Alternatively you can use this:

    while select X from A  

    Join B where A.BID==B.ID

    join C where A.CID==C.ID

    && A.ID == '5'

    {

    // Your code.

    }

    SQL STATEMENT:

    select A.X

    inner join B on A.BID = B.BID

    inner join C on C.ID = A.CID

    where A.ID = 5

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at
    RE: join tables in X++

    AX does not do a right join. You can put your "right" table as top of the select statement, and do an outer join on the "left" table. This way it will return all rows as a SQL right join would for the right table, and only rows that match based on the relation from the left table.

    Results are identical to what you would expect with a right join.

    So we do make use of the left outer join T-SQL syntax here instead, see what Mahmoud has linked.

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