这样连接product_unit_price RIGHT OUTER JOIN 
requisition ON product_unit_price.product_id = requisition.product_id
and requisition.order_number between product_unit_price.lowerbound and product_unit_price.upperbound如果再客户端输入时查询product_unit_price RIGHT OUTER JOIN 
requisition ON product_unit_price.product_id = requisition.product_id
and 输入的数量 between product_unit_price.lowerbound and product_unit_price.upperbound

解决方案 »

  1.   

    --??declare @input int
    set @input=2500select [unit_price]
    from product_unit_price 
    where
    [lowerbound]<=@input  and  [upperbound]>=@input
      

  2.   

    declare @input int
    @ID CHAR(12)set @input=20select [unit_price]
    from product_unit_price
    where
    product_id = @ID AND 
    [lowerbound]<=@input and [upperbound]>=@input
      

  3.   

    谢谢!!!Yang_(扬帆破浪)多个关联,此时不能关联订单表,:playwarcraft的恰少个关联,不过思路一样