Oracle,MySQL,MSSQL ServerºÍAccessÊý¾Ý¿âµÄͳ¼Æº¯Êý
Oracle,MySQL,MSSQL ServerºÍAccessÊý¾Ý¿âµÄͳ¼Æº¯Êý
ÎÒÃÇÔÚ±à³ÌÖг£ÓõÄͳ¼Æº¯ÊýÓмÆÊý,ÇóºÍ,Çó×î´óÖµ,Çó×îСֵ,Çóƽ¾ù,·½²îºÍ±ê×¼²î.
·½²î(Variance)
·½²îÊDZê׼ƫ²îµÄƽ·½¡£×éÖеÄÖµ£¬ÓëËüÃÇƽ¾ùÖµÖ®¼äÆ«Àë³Ì¶ÈµÄ¶ÈÁ¿¡£
±ê׼ƫ²î(Standard Deviation)
Ò»¸ö²ÎÊý£¬Ö¸³öÒ»ÖÖ·½Ê½£¬Ò»¸ö¸ÅÂʺ¯ÊýÒÔÕâÖÖ·½Ê½·Ö²¼ÔÚƽ¾ùÖµ¸½½ü£¬¶øƽ¾ùֵΪ·½²îµÄƽ·½¸ù¡£
ÓÃÀ´ÃèÊöÊýÖµ¼¯ºÏ£¬¼ÆËãÓëËãÊõ¾ùÖµ»òƽ¾ùÖµÖ®¼äµÄ²îÒì¡£
SQLÓï¾äÖеĺ¯ÊýÊDz»·Ö´óСдµÄ¡£
1¡¢COUNT
»ñµÃ¼Ç¼Êý
ËÄÖÖÊý¾Ý¿â¶¼Ò»Ñù,Ó÷¨ÈçÏÂ:
COUNT (*) ·µ»ØÌõ¼þ²éѯ½á¹ûÖÐËùÓмǼµÄÊýÁ¿.
COUNT (ALL expression) ¶Ô×éÖеÄÿһÐж¼¼ÆËã expression ²¢·µ»Ø·Ç¿ÕÖµµÄÊýÁ¿¡£
COUNT (DISTINCT expression) ¶Ô×éÖеÄÿһÐж¼¼ÆËã expression ²¢·µ»ØΨһ·Ç¿ÕÖµµÄÊýÁ¿¡£
2¡¢AVG
ƽ¾ùÖµ
ËÄÖÖÊý¾Ý¿âµÄÓ÷¨Óе㲻һÑù.
AccessºÍMySQL²»Ö§³ÖAVG(distinct expression)²Ù×÷,¶øOracleºÍMS SQL ServerÊÇÖ§³ÖµÄ.
3¡¢MIN, MAX
·Ö±ð·µ»Ø±í´ïʽÖеÄ×îСºÍ×î´óÖµ
ËÄÖÖÊý¾Ý¿âÇø±ð¸úÉÏÃæAVGº¯ÊýÒ»Ñù.
4¡¢Sum
ÇóºÍ
Ó÷¨ÓÐÇø±ð,Ò²ÊÇAccessºÍMySQL²»Ö§³Ö´ødistinctµÄ±í´ïʽÓ÷¨.
5¡¢±ê׼ƫ²îº¯Êý:
ËÄÖÖÊý¾Ý¿âµÄ²î±ð¸ü´óÁË,ÔںܶàµØ·½Ò²ÊDz»ÏàͬµÄ£º
²úÆ·
×ÜÌåÆ«²î
³éÑùÆ«²î
Ó÷¨
˵Ã÷
Access
StDevP()
StDev()
À¨ºÅÖÐÓÃ×Ö¶ÎÃû»òÕß×Ö¶ÎÔËËã±í´ïʽ
²»Ö§³Ö±í´ïʽǰ¼Ódistinct,PÊÇPopulation¡£
MS SQL Server
ͬÉÏ
ͬÉÏ
ͬÉÏ
Ö§³Ö±í´ïʽǰ¼Ódistinct
Oracle
StdDev_Pop()
StdDev()
StdDev_Samp()
ͬÉÏ
Ö§³Ö±í´ïʽǰ¼Ódistinct
MySQL
5.0.3°æÒÔÇ°
Std()
StdDev()
5.0.3°æÒÔºó,¼ÓÈëSTDDEV_POP()
5.0.3°æÒÔÇ°
ÎÞ
5.0.3°æÒÔºó¼ÓÈëSTDDEV_SAMP()
ͬÉÏ
²»Ö§³Ö±í´ïʽǰ¼Ódistinct
6¡¢·½²îº¯Êý:
²úÆ·
×ÜÌåÆ«²î
³éÑùÆ«²î
Ó÷¨
˵Ã÷
Access
VarP()
Var()
À¨ºÅÖÐÓÃ×Ö¶ÎÃû»òÕß×Ö¶ÎÔËËã±í´ïʽ
²»Ö§³Ö±í´ïʽǰ¼Ódistinct
MS SQL Server
ͬÉÏ
ͬÉÏ
ͬÉÏ
Ö§³Ö±í´ïʽǰ¼Ódistinct
Oracle
Var_pop()
var_samp()
variance
ͬÉÏ
Ö§³Ö±í´ïʽǰ¼Ódistinct
MySQL
4.1°æÒÔÇ°
ûÓÐ
5.0.3°æÒÔºó,¼ÓÈëVAR_POP()
5.0.3°æÒÔÇ°
ÎÞ
5.0.3°æÒÔºó¼ÓÈëVAR_SAMP()
ͬÉÏ
²»Ö§³Ö±í´ïʽǰ¼Ódistinct
¡¡¡¡ÎªÁ˸ü¸ßЧµØ²Ù×÷Êý¾Ý¿â£¬ÎÒÃÇÍùÍù¶¼Òª½èÖúÓÚһЩ²Ù×÷¹¤¾ß¡£ÔÚAccessÖУ¬µ±È»¾ÍÊÇÆä±¾ÉíÁË£¬¶øÔÚSQL ServerÖУ¬¿ÉÒÔÓÃÆóÒµ¹ÜÀíÆ÷ºÍ²éѯ·ÖÎöÆ÷À´Íê³ÉÄãÏëÒªÍê³ÉµÄ¹¤×÷£¬¶ÔÓ
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
ÔÚOracle Database 10gÖÐ,OracleµÄĿ¼½á¹¹ÊÇÓÉOracle_Base¼°Æä×ÓĿ¼Oracle_Home¡¢admin¡¢flash_recovery_areaºÍoradataĿ¼¹¹³ÉµÄ¡£Îª·½±ãÌÖÂÛ£¬ÓÃOracle_Base´ú±íOracleĿ¼Ê÷µÄ¸ù£¬ÓÃOracle_Home±íʾ¸ùĿ¼ÏµÄÖ÷Ŀ¼¡£
1.Oracle_BaseĿ¼
Oracle_Base´ú±íOracleĿ¼Ê÷µÄ¸ù¡£Èç¹ûʹÓÃOracle Universal Installer½øÐ ......
Êý¾Ý˵Ã÷Ò»ÇУº
create table dept(deptno number,deptname varchar2(20),mgrno number);
insert into dept values (1, '×ܹ«Ë¾', null);
insert into dept values (2, 'Õã½·Ö¹«Ë¾', 1);
insert into dept values (3, 'º¼ÖÝ·Ö¹«Ë¾', 2);
commit;
select t.* from dept t;
DEPTNO &n ......
OracleÊý¾Ý¿âSCNºÅÏê½â:
¡¡¡¡ÏµÍ³¼ì²éµãscn(v$database(checkpoint_change#))
¡¡¡¡Êý¾ÝÎļþ¼ì²éµã(v$datafile(checkpoint_change#))
¡¡¡¡Êý¾ÝÎļþÖÕÖ¹scn(v$datafile(last_change#))
¡¡¡¡Êý¾ÝÎļþÖдæ·ÅµÄ¼ì²éµã
¡¡¡¡Æô¶¯scn (v$datafile_header(checkpoint_change#)
¡¡¡¡1¡¢ÏµÍ³¼ì²éµãscn
¡¡¡¡µ±Ò»¸ö¼ì²éµã¶¯×÷Íê³ ......