好的,我已经阅读了这个网站,这里的成员建议的一对夫妇,sql 教科书等。问题:列出客户姓名、订单日期、订购数量、报价、账单金额和从 Premiere Products 订购的商品的描述。按订单日期和客户名称组织此报告表格:
SQL> desc customer
Name
----------------------
CUSTOMER_NUM
CUSTOMER_NAME
STREET
CITY
STATE
ZIP
BALANCE
CREDIT_LIMIT
REP_NUM
SQL> desc orders
Name
----------------------
ORDER_NUM
ORDER_DATE
CUSTOMER_NUM
SQL> desc order_line
Name
----------------------
ORDER_NUM
PART_NUM
NUM_ORDERED
QUOTED_PRICE
SQL> desc part
Name
----------------------
PART_NUM
DESCRIPT
ON_HAND
CLASS
WAREHOUSE
PRICE
这是我用于查询的内容:
SQL> SELECT CUSTOMER.CUSTOMER_NAME, ORDERS.ORDER_DATE,
2 ORDER_LINE.NUM_ORDERED, ORDER_LINE.QUOTED_PRICE,
3 SUM(Num_Ordered*Quoted_Price) AS Amt_Billed,
4 PART.DESCRIPT
5 FROM customer
6 INNER JOIN CUSTOMER INNER JOIN ORDERS ON
CUSTOMER.CUSTOMER_NUM =ORDERS.CUSTOMER_NUM
7 INNER JOIN ORDER_LINE ON ORDERS.ORDER_NUM = ORDER_LINE.ORDER_NUM
8 Inner JOIN ORDER_LINE ON PART.PART_NUM = ORDER_LINE.PART_NUM;
Inner JOIN ORDER_LINE ON PART.PART_NUM = ORDER_LINE.PART_NUM
*
ERROR at line 8:
ORA-00905: missing keyword
试了好几次,还做了个访问表,里面的SQL和我这里的基本一样。我正在使用 Oracle 11g。