[SQL Server2008]MDX º¯Êý²Î¿¼ (MDX)
MDX º¯Êý²Î¿¼
SQL Server 2008 Áª»ú´ÔÊ飨2009 Äê 7 Ô£©
MDX º¯Êý²Î¿¼ (MDX)
Microsoft SQL Server Analysis Services ÔÊÐíÔÚ¶àά±í´ïʽ (MDX) Óï·¨ÖÐʹÓú¯Êý¡£º¯Êý¿ÉÒÔÔÚÈκÎÓÐЧµÄ MDX Óï¾äÖÐʹÓ㬲¢ÇÒ¾³£ÓÃÓÚ²éѯ¡¢×Ô¶¨Òå»ã×ܶ¨ÒåÒÔ¼°ÆäËû¼ÆËã¡£ ±¾½Ú½éÉÜ Analysis Services ¸½´øµÄ MDX º¯Êý¡£
¿ÉÒÔʹÓÃÏÂÃæÕâЩ±í°´·µ»ØÖµµÄÀà±ðÀ´²éÕÒº¯Êý£¬Ò²¿ÉÒÔ´Ó°´×Öĸ˳ÐòÅÅÁеÄĿ¼Öа´Ãû³ÆÀ´Ñ¡Ôñº¯Êý¡£
Êý×麯Êý
º¯Êý ˵Ã÷
SetToArray (MDX)
½«Ò»¸ö»ò¶à¸ö¼¯×ª»»ÎªÊý×飬ÒÔ±ãÔÚÓû§¶¨Ò庯ÊýÖÐʹÓá£
²ã´Î½á¹¹º¯Êý
º¯Êý ˵Ã÷
Hierarchy (MDX)
·µ»Ø°üº¬Ö¸¶¨µÄ³ÉÔ±»ò¼¶±ðµÄ²ã´Î½á¹¹¡£
Dimension (MDX)
·µ»Ø°üº¬Ö¸¶¨µÄ³ÉÔ±¡¢¼¶±ð»ò²ã´Î½á¹¹µÄά¶È¡£
Dimensions (MDX)
·µ»ØÓÉÊýÖµ±í´ïʽ»ò×Ö·û´®±í´ïʽָ¶¨µÄ²ã´Î½á¹¹¡£
¼¶±ðº¯Êý
º¯Êý ˵Ã÷
Level (MDX)
·µ»Ø³ÉÔ±µÄ¼¶±ð¡£
Levels (MDX)
·µ»ØÓÉÊýÖµ±í´ïʽָ¶¨ÁËÔÚά¶È»ò²ã´Î½á¹¹ÖÐλÖõļ¶±ð£¬»ò·µ»ØÓÉ×Ö·û´®±í´ïʽָ¶¨ÁËÃû³ÆµÄ¼¶±ð¡£
Âß¼º¯Êý
º¯Êý ˵Ã÷
IsAncestor (MDX)
·µ»ØÒ»¸öÖ¸¶¨³ÉÔ±ÊÇ·ñΪÁíÒ»¸öÖ¸¶¨³ÉÔ±µÄ×æÏÈ¡£
IsEmpty (MDX)
·µ»Ø±í´ïʽµÄ¼ÆËã½á¹ûÊÇ·ñΪ¿Õµ¥ÔªÖµ¡£
IsGeneration (MDX)
·µ»ØÖ¸¶¨³ÉÔ±ÊÇ·ñ´¦ÓÚÖ¸¶¨µÄ´úÖС£
IsLeaf (MDX)
·µ»ØÖ¸¶¨³ÉÔ±ÊÇ·ñΪҶ³ÉÔ±¡£
IsSibling (MDX)
·µ»ØÒ»¸öÖ¸¶¨³ÉÔ±ÊÇ·ñΪÁíÒ»¸öÖ¸¶¨³ÉÔ±µÄͬ¼¶³ÉÔ±¡£
³ÉÔ±º¯Êý
º¯Êý ˵Ã÷
Ancestor (MDX)
·µ»Øij¸ö³ÉÔ±ÔÚÖ¸¶¨¼¶±ð»ò¾àÀëÉϵÄ×æÏÈ¡£
ClosingPeriod (MDX)
·µ»Øij¸ö³ÉÔ±ÔÚÖ¸¶¨¼¶±ðÉϵĺó´úÖеÄ×îºóÒ»¸öͬ¼¶¡£
Cousin (MDX)
·µ»ØÓëÖ¸¶¨µÄ×Ó³ÉÔ±ÔÚ¸¸³ÉԱϷ½¾ßÓÐÏàͬµÄÏà¶ÔλÖõÄ×Ó³ÉÔ±¡£
CurrentMember (MDX)
·µ»Øµü´ú¹ý³ÌÖÐÖ¸¶¨µÄά¶È»ò²ã´Î½á¹¹µÄµ±Ç°³ÉÔ±¡£
DataMember (MDX)
·µ»ØϵͳÉú³ÉµÄ¡¢Óëij¸öά¶ÈµÄ·ÇÒ¶³ÉÔ±Ïà¹ØÁªµÄÊý¾Ý³ÉÔ±¡£
DefaultMember (MDX)
·µ»Øά¶È»ò²ã´Î½á¹¹µÄĬÈϳÉÔ±¡£
FirstChild (MDX)
·µ»Ø³ÉÔ±µÄµÚÒ»¸ö×Ó³ÉÔ±¡£
FirstSibling (MDX)
·µ»Ø³ÉÔ±µÄ¸¸³ÉÔ±µÄµÚÒ»¸ö×Ó³ÉÔ±¡£
Item£¨³ÉÔ±£©(MDX)
·µ»ØÖ¸¶¨Ôª×éÖеijÉÔ±¡£
Lag (MDX)
·µ»ØÔÚËùÔÚά¶ÈÖÐλÖñÈÖ¸¶¨³ÉÔ±¿¿Ç°ÇÒ¿¿Ç°Î»ÊýΪָ¶¨Î»ÊýµÄ³ÉÔ±¡£
LastChild (MDX)
·µ»ØÖ¸¶¨³ÉÔ±µÄ×îºóÒ»¸ö×Ó³ÉÔ±¡£
LastSibling (MDX)
·µ»ØÖ¸¶¨³ÉÔ±µÄ¸¸³ÉÔ±µÄ×îºóÒ»¸ö×Ó³ÉÔ±¡£
Lead (MDX)
·µ»ØÔÚËùÔÚά¶ÈÖÐλÖñÈÖ¸¶¨³ÉÔ±¿¿ºóÇÒ¿¿º
Ïà¹ØÎĵµ£º
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£ ......
1.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖжÔ×ֶνøÐÐ null ÖµÅжϣ¬·ñÔò½«µ¼ÖÂÒýÇæ·ÅÆúʹÓÃË÷Òý¶ø½øÐÐÈ«±íɨÃ裬È磺
select id from t where num is null
¿ÉÒÔÔÚnumÉÏÉèÖÃĬÈÏÖµ0£¬È·±£±íÖÐnumÁÐûÓÐnullÖµ£¬È»ºóÕâÑù²éѯ£º
select id from t where num=0
2.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖÐʹÓÃ!=»ò<>²Ù×÷·û£¬·ñÔò½«ÒýÇæ·ÅÆúÊ ......
#ÐÂÔöÒ»¸ö×ֶΣ¬Ä¬ÈÏֵΪ0£¬·Ç¿Õ£¬×Ô¶¯Ôö³¤£¬Ö÷¼ü
alter table tabelname add new_field_name field_type default 0 not null auto_increment ,add primary key (new_field_name);
#Ôö¼ÓÒ»¸öÐÂ×Ö¶Î
alter table tableName add new_field_name field_type;
alter table tableNam ......
н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±í ......