以下查询有效但我想要2个字段
CREATE TABLE TOTAPPS (ANUM) AS SELECT a.A# FROM APPLICANT a.
这是
的工作//TOTAPPS
ANUM
--------
如果我想创建2个字段?
//Totapps
ANUM NUMBER
---------------------------
我应该如何创建表格?为了得到正确的答案? 而NUMBER是指ANUM,例如
CREATE TABLE TOTAPPS (ANUM) AS SELECT a.A# FROM APPLICANT a,
(NUMBER) AS SELECT COUNT(*) FROM a.A#;
但它没能奏效。
答案 0 :(得分:1)
调用列NUMBER不正确,因为它是保留字。假设您从第二个查询中想要在表中添加a.A#的不同值以及表中这些值的计数,您应该尝试这样做:
CREATE TABLE TOTAPPS (ANUM, MYNUMBER) AS
SELECT a.A#, COUNT(a.A#) FROM APPLICANT a GROUP BY a.A#;