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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / select certain fields
Finance forum
Suggested Answer

select certain fields

(0) ShareShare
ReportReport
Posted on by 100
 Is there a way to only select few fields without the need to put select RecId for all other un-needed table fields? (I had to select RecId because i don't need other fields and to enhance performance). But is it doable to only select 3 fields without the need to repeat recId?

while select RecId from table1 where table1.Field1 == 'XX'
    join RecId from table2 where table2.FieldX == table1.Field2
        && table2.IsField4 == NoYes::Yes
    join Field5 from table5 where table5.RecId == table3.Field6
    join Field7, Field8 from table6 where table6.Field9 == table5.RecId 
{
    info(strFmt(/Field5: %1/,table5.Field5));
    info(strFmt(/Field7: %1/,table6.Field7));
    info(strFmt(/Field8: %1/,table6.Field8));
}

maybe if i put them in view it will work.. but i want to see if i can do it in x++
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,272 Most Valuable Professional on at
    You could change the order of tables in the select statement and use exits join for table1 and table2.
  • Suggested answer
    MuthukumaranAX Profile Picture
    2,903 on at
    you can rewrite the condition like,
    write select logic for table 5 and 6 with the field list use join statement and for the other table you can use exist join
  • Martin Dráb Profile Picture
    238,272 Most Valuable Professional on at
    It doesn't matter. SQL is a declarative language - you describe what data you want; you don't define how the query will be executed (although you can influence it). Execution details are decided by SQL Server Query Optimizer.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans