除法运算是笛卡尔积的逆运算,可是我还是完全不懂事怎么算的,忘各位详细解答,谢谢O(∩_∩)O~

解决方案 »

  1.   

    笛卡尔积 运算 不就是乘法么?
    一个表A 有M行数据 表B 有N行数据
    做笛卡尔积不就是 M*N除法的逆运算就是乘法 
      

  2.   

    首先知道迪卡尔积是怎么算的先
    比如
    a 表
    col
    1
    2
    b表
    col
    3
    4
    ----------------------------------------------------------------
    -- Author  :fredrickhu(小F,向高手学习)
    -- Date    :2010-03-16 19:38:50
    -- Version:
    --      Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) 
    -- Nov 24 2008 13:01:59 
    -- Copyright (c) 1988-2005 Microsoft Corporation
    -- Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
    --
    ----------------------------------------------------------------
    --> 测试数据:[a]
    if object_id('[a]') is not null drop table [a]
    go 
    create table [a]([col] int)
    insert [a]
    select 1 union all
    select 2
    --> 测试数据:[b]
    if object_id('[b]') is not null drop table [b]
    go 
    create table [b]([col] int)
    insert [b]
    select 3 union all
    select 4
    --------------开始查询--------------------------select * from [a] cross join b----------------结果----------------------------
    /* col         col
    ----------- -----------
    1           3
    2           3
    1           4
    2           4(4 行受影响)
    */
     
      

  3.   

    表A有三条记录,表B有2条记录,两表的笛卡尔积有6条记录假设结果为表C.
    那么表C除以表A,就得到和表B中一样的2条记录了.就是这个道理.哈哈
      

  4.   

    假设有两个表,A表里面有3条记录,B表里面有4条记录,两表的笛卡尔积有3*4=12条记录,这个结里暂时设为表C,C表这个是A,B两表的积表,C这个表除以B,或者A,表,会得到另外一个表的记录,A或B。