-4
表交易:business_key = CUSTOMER_IDSQL:推導基於輸入值
customer_id|product_type|amount ------------------------------- cus1 | shoes | 100 cus1 | shoes | 50 cus1 | clothes | 100 cus2 | clothes | 500 cus2 |clothes | 21
表transactionsbycustomer:business_key = CUSTOMER_ID + PRODUCT_TYPE
customer_id|product_type|amount ------------------------------- cus1 |shoes |150 cus1 |clothes | 50 cus2 |clothes |521
我需要「transactionsbycustomer導出用於量值'表使用SQL?請幫忙!
你的意思是這樣的:'SELECT amount FROM transactionsbycustomer WHERE customer_id =「cus1」';?你特別需要什麼? – JiFus
請根據樣本數據添加預期輸出示例。 –
我想你正在考慮'GROUP BY'子句。 – mustaccio