Question: Below are the tables defined in ap database. Please return the following information for each general ledger account that is used by vendors in either

Below are the tables defined in ap database.
Please return the following information for each general ledger account that is used by vendors in either CA or OH states.
The account number
The account description
The invoice id
The terms id
The invoice sequence
The line item amount
The line item description
The vendor id
The vendor state
Using the result set got from the previous query, please return the following information for each general ledger account retrieved in the previous query.
The account description
The vendor state
The sum of the amount of the line items that have the same account number.
The count of the line items that have the same account number
Return only those accounts that are used by more than one line item.
Sort the result set in ascending sequence by the sum of the line item amount
Write the query using subqueries and aggregate functions.
Write the query using CTEs and window functions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!