Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Comparison of SQL and MDX Syntax

          Comparison of SQL and MDX Syntax
The Multidimensional Expressions (MDX) syntax is similar to the syntax of Structured Query Language (SQL). In many ways, the functionality supplied by MDX is also similar to that of SQL; with effort, you can even duplicate some of the functionality provided by MDX in SQL.
However, there are some striking differences between SQL and MDX. Here we provide a guide to these conceptual differences between SQL and MDX, from the perspective of an SQL developer.
Dimensions
The principal difference between SQL and MDX is the ability of MDX to reference multiple dimensions. Although it is possible to use SQL exclusively to query cubes in SQL Server 2000, MDX provides commands that are designed specifically to retrieve data as multidimensional data structures with almost any number of dimensions.
SQL refers to only two dimensions when processing queries: columns and rows. Because SQL was designed to handle only two-dimensional tabular data, the terms "column" and "row" have meaning in SQL syntax.
MDX, in comparison, can process one, two, three, or more dimensions in queries. Each dimension is referred to as an axis. The terms "column" and "row" in MDX are used only as aliases for the first two axis dimensions in an MDX query. Other dimensions are also aliased, but the aliases "column" and "row" hold no meaning to MDX. MDX supports such aliases for display purposes; many OLAP tools are incapable of displaying a result set with more than two dimensions. MDX can even process "zero-axis" queries that return only one cell from a cube, determined by a tuple constructed from the default member of each dimension in the cube.
SELECT and WHERE Clauses
In SQL, the SELECT clause is used to define the column layout for a query, and the WHERE clause is used to define the row layout. However, in MDX the SELECT clause can be used to define several axis dimensions, while the WHERE clause is used to r


Ïà¹ØÎĵµ£º

ÓÃË÷ÒýÌá¸ßSQL ServerÐÔÄÜ

 ÔÚ΢ÈíµÄSQL ServerϵͳÖÐͨ¹ýÓÐЧµÄʹÓÃË÷Òý¿ÉÒÔÌá¸ßÊý¾Ý¿âµÄ²éѯÐÔÄÜ£¬µ«ÊÇÐÔÄܵÄÌá¸ßÈ¡¾öÓÚÊý¾Ý¿âµÄʵÏÖ¡£ÔÚ±¾ÎÄÖн«»á¸æËßÄãÈçºÎʵÏÖË÷Òý²¢ÓÐЧµÄÌá¸ßÊý¾Ý¿âµÄÐÔÄÜ¡£¡¡
¡¡¡¡
¡¡¡¡ÔÚ¹ØÏµÐÍÊý¾Ý¿âÖÐʹÓÃË÷ÒýÄܹ»Ìá¸ßÊý¾Ý¿âÐÔÄÜ£¬ÕâÒ»µãÊǷdz£Ã÷ÏԵġ£ÓõÄË÷ÒýÔ½¶à£¬´ÓÊý¾Ý¿âϵͳÖеõ½Êý¾ÝµÄËٶȾÍÔ½¿ì¡£È»¶ø£¬Ðè ......

sql update Ó÷¨

½«b±íÖÐcallerÁеÄÖµ²åÈëa±íÖÐcallÁÐÖС£
 create table a
(
 fid int,
 call varchar(20),
 age int
)
create table b
(
 fid int,
 caller varchar(20),
 parentId int
)
select * from a
select * from b
insert into a values(1,null,19)
insert into a values(2,n ......

oracleÖÐʵÏֵݹé²éѯµÄSQL£¨connect by prior£©

    ǰ¶Îʱ¼ä×öÁËÒ»¸öÐéÄâ×éÖ¯µÄ´´½¨¡£Õâ¸öÐéÄâ×éÖ¯µÄ´´½¨ÊÇ´ÓÏÖÓеÄ×éÖ¯ÖжÁÈ¡Êý¾ÝÈ»ºó½øÐзÖÎö±£´æµ½ÐéÄâ×éÖ¯±íÖС£±£´æÖ®ºóдÈÕÖ¾·½±ãͬ²½µ½ÆäËüϵͳÖС£¹«Ë¾Ê¹ÓõÄÖ÷Òª¼¼ÊõÊÇSSH¡£ÓÉÓÚÊÇÐÂÈËûÓÐʲô¾­Ñ飬¼Ó֮ʱ¼ä±È½Ï½ôÆÈ£¬×îºóʹÓÃÒ»°ãµÄÂß¼­Ë¼Ïëͨ¹ýµÝ¹éÔÚhibernateÏÂ˳Àû´´½¨ÁË¡£¿ÉÊÇ´ÓÏÖÓеÄ×éÖ¯Ö ......

MS SQL µÝ¹éº¯Êý


/*
select *,dbo.getDeptTree(id) as DeptTree from sysdept
µÝ¹éº¯Êý
*/
CREATE  function getDeptTree(@NodeId int)
returns varchar(8000)
as
begin
    declare @ret varchar(8000),@ParentId int,@len int
    set @len = 0
  &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ