Notifications
Announcements
No record found.
How to apply union in while select query.Here is sql query
Select Column1 from Table1
Union
Select Column1 from Table2
and make sure there is no duplicate rows
*This post is locked for comments
You can't do that in the select statement, but you can define an union AOT query. See more in How to: Combine Data Sources in a Union Query.
Unfortunately AX doesn't support DISTINCT SQL keyword (what a shame!), so you'll have to either construct your query not to return duplicate rows or handle them in the application layer.
Martin is right. In addition, if you are only selecting a small number of fields, you can use group by in AOT query to achieve result similar to a DISTINCT. (Assume there are applicable aggregates you can apply on those fields)
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2