如有一个表(a)字段为 mobile(手机号)(,wap_type(站点类型),wap_name(站点名称)
另外一个表(b)字段分别为 mobile(手机号),group(记录),再一个表(c)的字段为mobile(手机号),record(记录)。
现在要建立一个视图实现这样的功能:就是视图有三个字段。
mobile(手机号),在b表中与该手机号相对应的的记录,在c表中与该手机号相对应的的记录

解决方案 »

  1.   

    select a.mobile,b.group from a,b where a.mobile=b.mobile
    union
    select a.mobile,c.record from a,c where a.mobile=c.mobile
      

  2.   

    现在要建立一个视图实现这样的功能:就是视图有三个字段。
    mobile(手机号),在b表中与该手机号相对应的的总的记录,在c表中与该手机号相对应的总的记录
      

  3.   

    select a.mobile,b.group,null from a,b where a.mobile=b.mobile
    union
    select a.mobile,null,c.record from a,c where a.mobile=c.mobile
      

  4.   

    select a.mobile,b.group,c.record from a,b ,c where a.mobile=b.mobile and a.mobile=c.mobile
      

  5.   

    回复人: onejune4450(中文字符) 这样还不行啊?那你还要咋样?你给个结果集的例子嘛。
      

  6.   

    select mobile,(select count(1) from b where a.mobile=b.mobile),
                  (select count(1) from c where a.mobile=c.mobile)
      from a;
      

  7.   

    select a.mobile,b.group,c.record from a,b ,c where a.mobile=b.mobile and a.mobile=c.mobile order by a.mobile and b.group