Skip to main content

Notifications

Community site session details

Community site session details

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

Union 2 table avoid dupplicate item except item match condition

(0) ShareShare
ReportReport
Posted on by

Hi,

I have 2 table Customer and MergedCustomer, because of business, I have to union those tables on there conditions:

MergedCustomer.CustId not in Customer.CustId.

OR (MergedCustomer.CustId in Customer.CustId And Customer.Age >= 40 And Customer.Age <= 50.

Is there anyway to write a Query to do this?

I try to google it but there is no suitable solution. 

So thank you really much if you help me. 

By the way, thank for reading my poor English post, it's not my native English so probably it seems silly sometime.

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Union 2 table avoid dupplicate item except item match condition

    while select MergedCustomer
    notexists join Customer
    where Customer.CustomerId == MergedCustomer.CustomerId
       &&(Customer.Age < 40
       || Customer.Age > 50)
    {
    }

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,118 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans