Microsoft Dynamics 365 Business Central

Top 10 customers by revenue

SQL query for Microsoft Dynamics 365 Business Central

Retrieve the top 10 customers based on their total revenue.

SELECT c.customer_name, SUM(o.total_amount) AS total_revenue FROM outgoinginvoices o JOIN customerledger c ON o.customer_id = c.customer_id GROUP BY c.customer_name ORDER BY total_revenue DESC LIMIT 10

Microsoft Dynamics 365 Business Central data model

Microsoft Dynamics 365 Business Central
Table Items

Microsoft Dynamics 365 Business Central
Table Item Categories

Microsoft Dynamics 365 Business Central
Table Customers

Microsoft Dynamics 365 Business Central
Table Customer Payments

Microsoft Dynamics 365 Business Central
Table Customer Payment Journals

Microsoft Dynamics 365 Business Central
Table Customer Financial Details

Microsoft Dynamics 365 Business Central
Table Contacts

Microsoft Dynamics 365 Business Central
Table Vendors

Microsoft Dynamics 365 Business Central
Table Company Information

Microsoft Dynamics 365 Business Central
Table Locations

Microsoft Dynamics 365 Business Central
Table Accounts

Microsoft Dynamics 365 Business Central
Table Sales Invoices

Microsoft Dynamics 365 Business Central
Table Journals

Microsoft Dynamics 365 Business Central
Table Journal Lines

Microsoft Dynamics 365 Business Central
Table General Ledger Entries

Microsoft Dynamics 365 Business Central
Table General Ledger Setup

Microsoft Dynamics 365 Business Central
Table Item Ledger Entries

Microsoft Dynamics 365 Business Central
Table Currencies

Microsoft Dynamics 365 Business Central
Table Sales Orders

Microsoft Dynamics 365 Business Central
Table Purchase Invoices

Microsoft Dynamics 365 Business Central
Table Purchase Orders

Microsoft Dynamics 365 Business Central
Table Inventory Posting Groups

Microsoft Dynamics 365 Business Central
Table General Product Posting Groups

Microsoft Dynamics 365 Business Central
Table Aged Accounts Receivables

Microsoft Dynamics 365 Business Central
Table Aged Accounts Payables

Use SQL on all your SaaS data

Magical SQL for Microsoft Dynamics 365 Business Central with Peliqan.io

Explore data in a rich spreadsheet UI. Use Magical SQL to combine and transform data. SQL queries become new tables that can be shared with business users and used in any BI tool such as Microsoft Power BI, Tableau or Metabase.

Let AI do the work for you

Peliqan’s AI assistant helps you to write SQL queries to get to insights fast. Ask your question in plain English and immediately see the result in Peliqan’s rich spreadsheet viewer.

Peliqan Ask AI willl write your SQL queries from plain English