FROM关键字现在找到了预期的Oralce SQL(多个连接)

时间:2017-11-14 05:34:08

标签: sql oracle

SELECT s.sales_date "Date of Sale", s.sales_id "Invoice Number',  a.category "Artwork Type",
         a.title "Artwork Title", c.last_name "Customer Last Name", e.last_name "Sales Person Last Name",
         p.purchase_amount "Price Cayucos Paid ($)", s.sales_amount "Selling Price ($)",
         s.sales_amount-p.purchase_amount "Profit ($)", e.commission_pct*s.sales_amount "Sales Person Commission ($)"
  FROM cayucos_sales s INNER JOIN cayucos_artworks a
      ON (s.artwork_id=a.artwork_id)
  INNER JOIN cayucos_employees e
      ON (s.salesperson_id=e.salesperson_id)
  INNER JOIN cayucos_purchases p
      ON (a.purchase_id=p.purchase_id)
  WHERE s.sales_date=TO_DATE('2017-&month', 'YYYY-MM');

1 个答案:

答案 0 :(得分:1)

标识符"Invoice Number'应使用双引号

关闭
SELECT s.sales_date "Date of Sale", s.sales_id "Invoice Number"