Question

SELECT vendor_name, TO_CHAR(INVOICE_TOTAL - (PAYMENT_TOTAL + CREDIT_TOTAL),'$999,999.90') AS "AMTDUE" 2 FROM AP.VENDORS 3 JOIN AP.INVOICES 4...

SELECT vendor_name, TO_CHAR(INVOICE_TOTAL - (PAYMENT_TOTAL + CREDIT_TOTAL),'$999,999.90') AS "AMTDUE"
2 FROM AP.VENDORS
3 JOIN AP.INVOICES
4 ON vendors.vendor_id = invoices.vendor_id
5 GROUP BY vendor_name
6 WHERE (INVOICE_TOTAL - (PAYMENT_TOTAL + CREDIT_TOTAL)) > 0;
WHERE (INVOICE_TOTAL - (PAYMENT_TOTAL + CREDIT_TOTAL)) > 0
*
ERROR at line 6:
ORA-00933: SQL command not properly ended

Homework Answers

Answer #1

Dear Student ,

As per requirement submitted above kindly find below solution.

Error details :

  • group by should be the last clause
  • where need to be used before the group by clause
  • This SQL query needs to use having clause

Below is the correct query

SELECT
   vendor_name,
   TO_CHAR(INVOICE_TOTAL - (PAYMENT_TOTAL + CREDIT_TOTAL),'$999,999.90') AS "AMTDUE"
FROM
   VENDORS JOIN INVOICES ON vendors.vendor_id = invoices.vendor_id
GROUP BY vendor_name
having (INVOICE_TOTAL - (PAYMENT_TOTAL + CREDIT_TOTAL)) > 0;

NOTE :PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What would be the Mongodb equivalent of the 2 following SQL queries? SELECT A.Lname FROM Assistant...
What would be the Mongodb equivalent of the 2 following SQL queries? SELECT A.Lname FROM Assistant A INNER JOIN Manager Ma ON A.RefNum = Ma.RefNum GROUP BY A.Lname HAVING COUNT(DISTINCT Ma.Manager) > 1; SELECT G.Cname, R.Snum FROM Game G INNER JOIN Role R ON G.Cnum = R.Cnum WHERE G.level>200;
Customers ID Name Street City Zip email 1 Emily 101 Anza St San Francisco 94118 2...
Customers ID Name Street City Zip email 1 Emily 101 Anza St San Francisco 94118 2 Amy 1 Houston Ave New York 12111 3 John 29 Sunset Blvd Los Angeles 45643 4 Pam 800 Market St San Francisco 94080 5 Sue 400 Muir Ave Redwood City 94598 6 Chris 987 A Ave New York 13111 7 Todd 788 Harrison St San Francisco 94117 Products ID Product_name Price Quantity 1 Metal pen 5.99 20 2 Surge protector 25.99 0 3 pencil...
x y 0 6 1 5 2 3 3 1 4 0 A) From the above...
x y 0 6 1 5 2 3 3 1 4 0 A) From the above table, calculate the predicted value of y for x0=5. B) Calculate the standard error of the forecast error. C) Calculate a 95% confidence interval of y given x0=5
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table....
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table. SQL provides two different techniques for querying data from multiple tables: • The SQL subquery • The SQL join As you will learn, although both work with multiple tables, they are used for slightly different purposes. We used WMCRM database which is what we created in Lab 4. Here is the summary of the database schema (where schema is used in its meaning of...
1)   If 67+3?(?)+4?^2(?(?))^3=0 and ?(−4)=−1, find ?′(−4).      f'(-4)= 2)   Find an equation of the tangent...
1)   If 67+3?(?)+4?^2(?(?))^3=0 and ?(−4)=−1, find ?′(−4).      f'(-4)= 2)   Find an equation of the tangent line to the curve ?^2=?^3(5−?) (a piriform) at the point (1,2). The equation of this tangent line can be written in the form ?=??+?, where ?=_________ and ?=________ find m and b
The following data were used in a regression study. Observation 1 2 3 4 5 6...
The following data were used in a regression study. Observation 1 2 3 4 5 6 7 8 9 xi 2 3 4 5 7 7 7 8 9 yi 3 5 4 7 4 6 9 4 11 (a) Develop an estimated regression equation for these data. (Round your numerical values to two decimal places.) ŷ = (b) Construct a plot of the residuals. A residual plot has 9 points plotted on it. The horizontal axis ranges from 0...
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a....
A(n) _____ is a query that is embedded (or nested) inside another query. Select one: a. operator b. subquery c. alias d. view If a subquery returns list of values, which operator can be used in the outer query predicate? Select one: a. > b. < c. IN d. = Which query returns a list of all products with a price greater than or equal to the average product price? Select one: a. SELECT P_CODE,MAX(AVG(P_PRICE)) FROM PRODUCT GROUP BY P_CODE;...
2. Write the output matrix “v” t = [2:4]; k = [1:3]; v = t.*k –...
2. Write the output matrix “v” t = [2:4]; k = [1:3]; v = t.*k – k.^2 4. Given: D = [1 2 3 4 5 6 7 8 9] (3x3) . Which command will extract the submatrix [1 2 3 4 5 6] (2x3) ? a. D[1:2,1:3] b. D(1,2 ;1,3) c. [D(1:2),D(1:3)] d. D(1:2,1:3) 14. What will be the dimension of matrix B? B=[ones(3) zeros(3) rand(3); 2*eye(9)] 18. Find the value of “C” A=1:2:10; B=linspace(1,5,5); C = length(A)*B(2)+A(5)*B(3); 19....
there are 2 comedies, 5 tragedies and 6 musicals available for production. you randomly select 4...
there are 2 comedies, 5 tragedies and 6 musicals available for production. you randomly select 4 titles from the group to read find the probability that you choose 1 comedy, 1 tragedy, and 2 musicals
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects....
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch08_ConstructCo database are shown in Figure P8.1. Use this database to answer the following problems. Database Schema The schema for the Ch08_ConstructCo database is shown below and should be used to answer the next several problems. Click this image to view it in its own...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT