SQL Write a SELECT statement then returns two columns from t

SQL

Write a SELECT statement then returns two columns from the GLAccounts table: AccountNo and AccountDescription. The result set should have one row for each account number that has never been used. Sort the final result set by AccountNo.
Hint: use an outer join to the InvoiceLineItem table. To code “account number that has never been used” ---- WHERE InvoiceLineItems.AccountNo IS NULL
Here is result set with 54 rows:

Account... AccountDescription 100 Cash 2 110 Accounts Receivable 3 120 Book Inventory 4 162 Capitalized Lease 167 Software 6 181 Book Development 7 200 Accounts Payable 8 206 Royalties Payable 9 221 401K Employee Contributions 10 230 Sales Taxes Payable 11 234 Medicare Taxes Payable 12 235 Income Taxes Payable 13 237 State Payroll Taxes Payable

Solution

SELECT AccountNo, AccountDescription FROM GLAccounts FULL OUTERJOIN ON InvoiceLineItem WHERE InvoiceLineItems.AccountNo IS NULL ORDERBY AccountNo;

if you like this answer, please give a thumbs up and if you have some doubt just ask in the comment section below. I will try to help. Cheers

SQL Write a SELECT statement then returns two columns from the GLAccounts table: AccountNo and AccountDescription. The result set should have one row for each a

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site