我在把两个字段计算成一个字段时遇到了麻烦
The Table columns are as follows
Name Null? Type
----------------------------------------- -------- ----------------------------
STUD_TYPE VARCHAR2(15)
FACULTY VARCHAR2(25)
COURSE_YEAR NUMBER(1)
PAYOUT_DATE DATE
STIPEND NUMBER(3)
COMPENSATION NUMBER(4,2)
TOTAL_PAID NUMBER(5,2)
和.ctl文件
LOAD DATA
INFILE 'payments.dat'
TRUNCATE
INTO TABLE CATALOG
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(
Stud_type,
Faculty,
Course_year,
Payout_date,
Stipend,
Compensation,
Total_paid "SUM(Stipend,Compensation)"
)
从.dat文件加载的0个字段出现错误
Rejected - Error on table CATALOG, column TOTAL_PAID.
ORA-00934: group function is not allowed here
1条答案
按热度按时间c2e8gylq1#
诚然,你是在把这两个值相加,但你应该使用的不是
sum
函数,而是字面上的 add values。控制文件-注意
total_paid
列的值:测试:
结果: