???SQL???????????
???????????? ???????[ 2016/7/8 17:25:45 ] ????????SQL ???????? ???????
?????????????????????COLOR_FREQUENCY ???е????ж??????? CONSECUTIVE_NUMBER ???е? FREQUENCY ?С?????????????????????????????????????????
????CREATE TABLE T_SHIRT(COLOR VARCHAR(30) NOT NULL?? SIZE CHAR(1) NOT NULL);
????INSERT INTO T_SHIRT
????SELECT COLOR?? 'M' AS SIZE
????FROM COLOR_FREQUENCY JOIN CONSECUTIVE_NUMBER
????ON NUM BETWEEN 1 AND FREQUENCY;
????SELECT COLOR?? COUNT(*) FROM T_SHIRT GROUP BY COLOR;
????COLOR 2
????------------------------------ -----------
????AMBER 3
????BLACK 1
????BLUE 1
????GREEN 3
????RED 37
????SILVER 12
????WHITE 2 ;
????????T_SHIRT ???????? 37+12+3+3+2+1+1 = 57 ?С?????t??????????????
?????????????????и?????????????
????????????е???????????????? SIZE ???????????
????CREATE TABLE SIZE_FREQUENCY(SIZE CHAR(1)?? FREQUENCY SMALLINT);
????INSERT INTO SIZE_FREQUENCY VALUES
????('S'?? 5)?? ('M'??7)?? ('L'?? 9);
??????????????????????? T_SHIRT ???
????INSERT INTO T_SHIRT
????SELECT COLOR?? SIZE
????FROM
????(SELECT COLOR FROM COLOR_FREQUENCY JOIN CONSECUTIVE_NUMBER ON NUM
????BETWEEN 1 AND FREQUENCY) C??
????(SELECT SIZE FROM SIZE_FREQUENCY JOIN CONSECUTIVE_NUMBER ON NUM BETWEEN
????1 AND FREQUENCY) S
?????????????????? 57 ?У?????????????????? 5+7+9=21 ?С????????????????κ?????????????????????????е????н????????????е????У???????? 57*21 ?С?
???????????????????????????С?????????????????·??????????????????У????????????????С?Щ?? INSERT ????????????? INSERT ????????±??????
????(SELECT SIZE FROM SIZE_FREQUENCY JOIN CONSECUTIVE_NUMBER ON NUM BETWEEN
????1 AND FREQUENCY AND SIZE='L') S
?????????????? INSERT ????н???????????????
????(SELECT SIZE FROM SIZE_FREQUENCY JOIN CONSECUTIVE_NUMBER ON NUM BETWEEN
????1 AND FREQUENCY AND SIZE<>'L') S
???????????????е?????
????????????????????м??????? CAR ???
????CREATE TABLE CAR(
????MAKE VARCHAR(20) NOT NULL??
????MODEL VARCHAR(20) NOT NULL??
????OTHER_DATA VARCHAR(20));
????????????????е???????????????Щ??????? MAKE/MODEL ????????“TOYOTA METRO”??“GEO CAMRY”??????????? MAKE ?к? MODEL ???????????????????????????Ч???MAKE??MODEL??????????
????CREATE TABLE MAKE_MODEL_FREQUENCY(MAKE VARCHAR(20)?? MODEL VARCHAR(20)??
????FREQUENCY SMALLINT);
????INSERT INTO MAKE_MODEL_FREQUENCY VALUES
????('TOYOTA'??'CAMRY'?? 40)?? ('HONDA'??'ACCORD'??40)?? ('CHEVY'?? 'PRIZM'?? 5)??
????('GEO'??'PRIZM'?? 5)?? ('CHEVY'?? 'METRO'?? 5)?? ('GEO'?? 'METRO'?? 10);
??????????ù?????????????????????????????????? CONSECUTIVE_NUMBER ?? MAKE_MODEL_FREQUENCY ?????
???????????????
????????????д????????????????в?????????????????????????????????????д?????????????????????????????????н?????????????????????????????????????????????????н?????????????????????????????????????????????????????????????????? 0??
????CREATE TABLE NAMES(
????FULL_NAME VARCHAR(50) NOT NULL??
????ORDERED_ON INT);
????INSERT INTO NAMES(FULL_NAME?? ORDERED_ON)
????SELECT TABNAME || '?? ' || COLNAME AS FULL_NAME??
????SYSFUN.RAND() * 10000 AS ORDERED_ON
????FROM SYSCAT.COLUMNS;
????CREATE INDEX NAMES_FULL_NAME ON NAMES(FULL_NAME);
????CREATE INDEX NAMES_ORDER ON NAMES(ORDERED_ON);
????REORG TABLE DB2ADMIN.NAMES INDEX DB2ADMIN.NAMES_ORDER;
????RUNSTATS ON TABLE DB2ADMIN.NAMES AND DETAILED INDEXES ALL;
???????????????????? NAMES_FULL_NAME ??????????????????????????? 0?????????????????????????洢???
??????????????????????????? NAMES_FULL_NAME ??????????? 0 ?? 1 ?????κθ???????????????????????????Χ??
??????????
????????????????ι?????????????????????????????????????????????????????????????м???????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??γ????????????????????????????????????漰??Щ???????????????????????????????????????????????????????????????е???????????????????????????????????????Щ??????????????????????Ч?????????????????????????????????????α?????????????????????????????????????????????????????????????????????????????????????????????????????????????????γ?????????????????????????????ζ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????