我列出了order_name
中不同日期的订单供应商列表。
我想按照规则只选择订单:
列为order_date
,supplier_name
,address
,cost
, select
*
from
tbl_supplier_order t1
where
t1.order_date >= CONVERT(date, '2016-01-01')
and (t1.order_date < CONVERT(date, '2016-02-19')
AND t1.supplier_name not in ('A','B','C'))
and (t1.order_date < CONVERT(date, '2016-03-12')
AND t1.supplier_name not in ('P','Q','R'))
and (t1.order_date < CONVERT(date, '2016-03-15')
AND t1.supplier_name not in ('M','N'))
and (t1.order_date < CONVERT(date, '2016-05-07')
AND t1.supplier_name not in ('W','X','Y','Z'))
。
我最初的做法是:
$( "#prodBasketPaymOptIdRow1 td:nth-child(3)" ).text( "i want to set text here" );
答案 0 :(得分:0)
你能准确说明你想要做什么吗?
If supplier_name: A,B,C order_date:2016-02-19
您是否说您的一个条件是您只想选择supplier_name为A,B,C且订单日期为2016-2-19的行,其他条件如下(可以是任何其他组合还有)?
答案 1 :(得分:0)
没有对此进行测试,但也许您可以尝试这样的事情。
select * from tbl_supplier_order t1 where
(t1.order_date>CONVERT(date,'2016-01-01') AND t1.supplier_name not in ('A','B','C','P','Q','R','M','N','W','X','Y','Z'))
OR (t1.order_date>CONVERT(date,'2016-02-19') AND t1.supplier_name in ('A','B','C'))
OR (t1.order_date>CONVERT(date,'2016-03-12') AND t1.supplier_name in ('P','Q','R'))
OR (t1.order_date>CONVERT(date,'2016-03-15') AND t1.supplier_name in ('M','N'))
OR (t1.order_date>CONVERT(date,'2016-05-17') AND t1.supplier_name in ('W','X','Y','Z'))