Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM-DB

Posted on by 5,005

How to join more than 10 tables in DB

*This post is locked for comments

  • Verified answer
    imayur Profile Picture
    imayur 630 on at
    RE: CRM-DB

    You can use Filtered views where you get lookups names and options sets are already retrieved

    then views with entity name where only lookup names retrived

    Then there is base tables where you have to perform joins normaly

    Refer below sql for joins, you can select other fields for related entities as well using prefix used in join statement

    SELECT a.new_name,b.new_name,b.new_otherfield,c.new_name,d.new_name,e.new_name,f.new_name new_aBase a
    join new_bBase b
    on a.new_aid = b.new_aid
    join new_cBase c
    on a.new_aid = c.new_aid
    join new_dBase d
    on a.new_aid = d.new_aid
    join new_eBase e
    on a.new_aid = e.new_aid
    join new_fBase f
    on a.new_aid = f.new_aid
    join new_gBase g
    on a.new_aid = g.new_aid

    and so on..

  • sandeepc Profile Picture
    sandeepc 5,005 on at
    RE: CRM-DB

    can i get the SQL code . will makes both answers as verified

  • Verified answer
    Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: CRM-DB

    with more than 10 inner join statements.

    If you are talking about CRM OnPremise than you can use the Filtered Views (like SELECT * FROM FilteredAccount) and after write the SQL statements as any other DB

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans