Gcobani Mkontwana

Gcobani Mkontwana

  • 557
  • 1.9k
  • 405k

Query to return all lists of invoices ordered by billing date?

Nov 11 2020 2:43 PM
Hi Team
 
I need some help, i have two tables here below "Invoices and Customers". Write sql query to return a list of all invoices. each invoice, show the invoice Id, billing date, the customer name, the name of the customer who refered. Should be order by billing date?
  1. // Invoices  
  2.   
  3. SELECT TOP (1000) [Id]  
  4.       ,[BillingDate]  
  5.       ,[CustomerId]  
  6.   FROM [eNtsaRegistration].[dbo].[Invoices]  
  7.   
  8. // Customers  
  9. SELECT TOP (1000) [Id]  
  10.       ,[Name]  
  11.       ,[ReferredBy]  
  12.   FROM [eNtsaRegistration].[dbo].[Customers]  
 

Answers (2)