select min(cost),airline from flight group by airline

解决方案 »

  1.   

    select min(cost),airline from flight group by airline
      

  2.   

    select a.source, a.destination, a.cost, a.airline from flight as a, 
    (select source, destination, min(cost) as cost from flight 
    group by source, destination) as b
    where a.cost = b.cost 
    and a.source = b.source 
    and a.destination = b.destination
      

  3.   

    select DISTINCT(a.source, a.destination), a.cost, a.airline from flight as a order by cost asc
      

  4.   

    不是简单的sql语句,里面含有算法的
      

  5.   

    select min(cost) from flight group by source,destination
      

  6.   

    这是我们的作业,它的答案是不能解,原因是拓扑图中含有环,抱歉!
    但如果没有环,是可以解的,但SQL语句较复杂(要用表的连接,as等)!
    谢谢大家的回答。来者有分!