我需要为表“产品”生成一个 sql 查询。表结构如下:
item_no pack_no name model sellingprice discount price_rs quality
101 1001 aa 2001 $500 10% Rs.24750 excellent
102 1002 bb 1996 $400 5% Rs.20900 poor
103 1003 cx 1986 $400 5% Rs.20900 good
104 1004 dx 2010 $500 10% Rs.24750 poor
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
500 5000 bx 1998 $200 10% Rs.9900 very good
等等..
我有各种条件,如下所示:
说,
我需要过滤所有产品
model is between 1990 to 2010
AND
sellingprice is between 600 to 700
AND
discount is between 0 to 20%
AND
quality is between good and excellent
所有这些都在一个 SELECT 语句中。有可能还是我需要创建不同的语句然后连接结果?