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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to integrate queries by using view?

(0) ShareShare
ReportReport
Posted on by 20
Hi, experts.
I want to integrate these three queries into one. I attempted to create a view for the second query, selecting values from table B without going through table A, and tried to integrate the values from the view along with the data from table C into a string variable for the parent query, but it didn't work well. I want to filter the data based on the condition /tableB.FieldY == tableA.Field1/ only for Field X. I want to get other data without any conditions. How can I integrate them into one query?


while select
        Field1,            
        Field2,            
        Field3,                      
    from
        transactionTemp
{
    TableB transactionLine;
    select minOf(FieldX)  
    from transactionLine
    where transactionLine.FieldY == transactionTemp.Field1;
    
    TableC tempSplit;
    tempS.Field1 = transactionTemp.Field1;
    tempS.Field2 = transactionTemp.Field2;
    tempS.Field3 = transactionLine.FieldX;  
    tempS.insert();
}
while select
        Field1,            
        Field2,            
        Field3,                      
    from
        tempS
    order by
        tempS.Field1,  
        tempS.Field2,  
        tempS.Field3   
{
    str field1 = tempS.Field1;  
    str field2 = tempS.Field2;  
    str field3 = tempS.Field3;  
}
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,152 Most Valuable Professional on at
    Wouldn't something like this do the job?
    select Field1, Field2 from transactionTemp
        group by Field1, Field2
        join minOf(FieldX) from transactionLine
            where transactionLine.FieldY == transactionTemp.Field1

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 649

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 447 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 242 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans