informix怎么出来。总数不是60吗

解决方案 »

  1.   

    Requested 60的OrderID是100003,100003在Order表里对应的SupplierID是3,也就是Oracle,所以Oracle没有显示。答案里有informix是因为有另外一个条件是没有出现在Order表里的SupplierName也要列出来。
      

  2.   

    是否能用IN? 不知我这个方法行不行.还是请高手指点.
    SELECT SupplierName 
        FROM Supplier 
        WHERE SupplierID IN (
            SELECT SupplierID 
                FROM Order 
                WHERE OrderID NOT IN (
                    SELECT OrderID
                        FROM OrderItem 
                        GROUP BY OrderID HAVING SUM(Requested) < 70))
      

  3.   

    这个问题被提示要用到union,并且在SQL-92下工作。
      

  4.   

    不通,union只是将两个或更多查询的结果组合为单个结果集,他又不具备
    筛选得功能
    回家耍去也
      

  5.   

    Union可以用的,先分别查询出大等于70的和不存在的,然后Union
      

  6.   

    答案要在SQL-92下工作,就说明不能用join,不知道我的理解对不对?
      

  7.   

    1."SQL-92下工作,就说明不能用join"---不对
    2.
    SELECT a.SupplierName 
    from (select OrderID 
          from Supplier 
          group by OrderID 
          having isnull(sum(Requested),0)>=70) a,[Order] b,OrderItem c
    where a.OrderID=b.OrderID and b.SupplierID=c.SupplierID
    union 
    select d.SupplierName 
    from Supplier d 
    where not exists (select * 
                      from [Order] e 
                      where d.SupplierID=e.SupplierID)
      

  8.   

    sorry, it should be SQL-89
      

  9.   

    same tables, another question (50 fen)http://www.csdn.net/expert/topic/988/988572.xml?temp=.1363642
      

  10.   

    The output should be:SupplierName  CountOfOrdersWithLessThan70Items
    Oracle        1
    IBM           1
    Informix      0
    Microsoft     0The solution must work with SQL-92.