David Smith

David Smith

  • NA
  • 2k
  • 0

Oracle Sub query

Mar 15 2014 5:32 AM
I having a trouble with the oracle sql query below, can some help me. I am trying to get a count of all JS records parts purchase in November 2006. The sub query is working find. I am getting an syntax error in the select Count query.
Select Count(*) as JS_Parts
From ITEM
Where ITEM IN
(Select CUSTOMERID,
CUSTOMERFIRSTNAME,
CUSTOMERLASTNAME,
INVOICEID,
INVOICEDATE,
ITEMID,
DELQUANTITY,
SOQUANTITY,
RETAILPRICE,
DISCOUNT,
EXTENDEDAMOUNT,
DESCRIPTION
From CUSTOMER, INVOICE, ITEM
Where CUSTOMER.CUSTOMERID = INVOICE.FK_CUSTOMERID and
INVOICE.INVOICEID = ITEM.FK_INVOICEID and
CUSTOMERID = 2250 and
to_char(INVOICEDATE,'MM') = '11' and to_char(INVOICEDATE,'YYYY') = '2006');
 

Answers (1)