我的应用程序根目录中有一个名为 product.csv 的文件。我想从文件中读取。但我得到文件未找到异常。这是我写的代码。
SELECT tenant_charge_date as statement_date, tenant_charge_id as reference, tenant_charge_total_amount as debit, NULL as credit, 'Charge' as type FROM accounts_tenant_charge
UNION ALL
SELECT tenant_payment_date as statement_date, tenant_payment_id as reference, NULL as debit, tenant_payment_amount as credit, 'Payment' as type FROM accounts_tenant_payment
ORDER BY statement_date
我做错了什么?
修改 顺便说一句,如果这对我有用,我正在使用Windows操作系统。
答案 0 :(得分:1)
您需要使用相对文件路径"product.csv"
而不是"/product.csv"
来查看驱动器的根目录。