|
Originally posted by liangke at 2005-1-27 09:08 AM:
CREATE TABLE DB2ADMIN.SALES
(CUSTOMER_ID INT NOT NULL, ITEM_ID INT NOT NULL,
SALE_QUANTITY SMALLINT NOT NULL, SALE_DATE DATE NOT NULL);
INSERT INTO SALES
SELECT
SYSFUN.RAND()*500 + 1 AS CU ...
这是一段SQL语句。
CREATE TABLE DB2ADMIN.SALES
(CUSTOMER_ID INT NOT NULL, ITEM_ID INT NOT NULL,
SALE_QUANTITY SMALLINT NOT NULL, SALE_DATE DATE NOT NULL);
INSERT INTO SALES
——创建一个名为 DB2ADMIN.SALES的表,并将其插入到SALES数据库中。
SELECT
SYSFUN.RAND()*500 + 1 AS CUSTOMER_ID,
SYSFUN.RAND()*100 + 1 AS ITEM_ID,
1 + SYSFUN.RAND()*10 AS SALE_QUANTITY,
DATE('01/01/2003') + (SYSFUN.RAND()*200) DAYS AS SALE_DATE
FROM SYSCAT.COLUMNS;
——从SYSCAT.COLUMNS表中选取相应字段的数据处理后作为DB2ADMIN.SALES相应字段的数据。
这段SQL语句从语法上是这样的,不过实际运行时……俺就不晓得啦。 |
|