解决方案 »

  1.   

    没见过说left join之后有顺序的,聚集索引也就保证单表顺序而已,你这个要指定order ny
      

  2.   

    那如何可以达到我要的结果呢,不必用left join ,只要检索出表2 对应 表1 中的ProductId
      

  3.   

    方法一:
    select a.ProductId
    from ancTOP a 
    where exists(select 1 from Products b where a.货号=b.SKU)方法二:
    select a.ProductId
    from ancTOP a,Products b
    where a.货号=b.SKU
      

  4.   

    上面音讯拼写有错方法一:
    select a.ProductId
    from Products a 
    where exists(select 1 from andTOP b where b.货号=a.SKU)方法二:
    select b.ProductId
    from andTOP a,Products b
    where a.货号=b.SKU
      

  5.   


    如果你想要第一条记录是39530就加排序 order by productId desc
    这样就达到要求了,何必去纠结这个排序,又不是没有办法做到
      

  6.   

    不是要排序问题,而是我的要找出对应的值,任何排序都会对不上,需要VLOOKUP的SQL查询功能