Can anyone tell me what's wrong with my code? I'm trying to use pipes and I plan to tidy it up to make it flow a bit more later in regards to the normal text bits but I want to know why it isn't working now to begin with.
谁能告诉我我的代码有什么问题?我正在尝试使用管道,我打算整理它以使其稍后关于普通文本位流动,但我想知道为什么它现在不起作用。
SELECT
CUSTOMER.CUSTOMER_NO ||'Customer Number'||
CUSTOMER.FIRST_NAME ||' First name '||
CUSTOMER.SURNAME ||'Last name'||
CAR.MAKE ||'Make'||
CAR.MODEL ||'Model'||
CAR.CAR_NO ||' '||
CAR.PURCHASE_PRICE ||'Price Bought'||
CAR.SOLD_PRICE ||'Price Sold'||
CAR.SOLD_PRICE - CAR.PURCHASE_PRICE ||'Profit'||
STAFF.FIRST_NAME ||' '||
STAFF.STAFF_NO ||' '||
AS "All sales in July 2015"
FROM CUSTOMER, CAR, STAFF
WHERE CAR.SOLD_BY_CUSTOMER_NO = CUSTOMER.CUSTOMER_NO AND SOLD_DATE between '07/01/2015' AND '07/31/2015' AND STAFF.STAFF_NO = CAR.SOLD_BY_STAFF_NO;
1 个解决方案
#1
0
Just remove the last pipe as below
只需删除最后一根管道,如下所示
SELECT
CUSTOMER.CUSTOMER_NO ||'Customer Number'||
CUSTOMER.FIRST_NAME ||' First name '||
CUSTOMER.SURNAME ||'Last name'||
CAR.MAKE ||'Make'||
CAR.MODEL ||'Model'||
CAR.CAR_NO ||' '||
CAR.PURCHASE_PRICE ||'Price Bought'||
CAR.SOLD_PRICE ||'Price Sold'||
CAR.SOLD_PRICE - CAR.PURCHASE_PRICE ||'Profit'||
STAFF.FIRST_NAME ||' '||
STAFF.STAFF_NO ||' '
AS "All sales in July 2015"
FROM CUSTOMER, CAR, STAFF
WHERE CAR.SOLD_BY_CUSTOMER_NO = CUSTOMER.CUSTOMER_NO AND SOLD_DATE between '07/01/2015' AND '07/31/2015' AND STAFF.STAFF_NO = CAR.SOLD_BY_STAFF_NO;
#1
0
Just remove the last pipe as below
只需删除最后一根管道,如下所示
SELECT
CUSTOMER.CUSTOMER_NO ||'Customer Number'||
CUSTOMER.FIRST_NAME ||' First name '||
CUSTOMER.SURNAME ||'Last name'||
CAR.MAKE ||'Make'||
CAR.MODEL ||'Model'||
CAR.CAR_NO ||' '||
CAR.PURCHASE_PRICE ||'Price Bought'||
CAR.SOLD_PRICE ||'Price Sold'||
CAR.SOLD_PRICE - CAR.PURCHASE_PRICE ||'Profit'||
STAFF.FIRST_NAME ||' '||
STAFF.STAFF_NO ||' '
AS "All sales in July 2015"
FROM CUSTOMER, CAR, STAFF
WHERE CAR.SOLD_BY_CUSTOMER_NO = CUSTOMER.CUSTOMER_NO AND SOLD_DATE between '07/01/2015' AND '07/31/2015' AND STAFF.STAFF_NO = CAR.SOLD_BY_STAFF_NO;