我在向表中选择数据并回显例如
--------------------------------------
id | bought | customerName |
--------------------------------------
1 | 70 | customer 1 |
2 | 20 | customer 2 |
3 | 50 | customer 3 |
4 | 30 | customer 4 |
5 | 80 | customer 5 |
6 | 100 | customer 6 |
--------------------------------------
我想要做的是通过购买订购并选择50到100之间购买的产品
customer 3 --- 50
customer 1 --- 70
customer 5 --- 80
customer 6 --- 100
答案 0 :(得分:1)
您可以尝试此选择数据
"SELECT * FROM table_name WHERE bought BETWEEN 50 AND 100 ORDER BY bought ASC"
答案 1 :(得分:0)
试试这个
SELECT * FROM table_name WHERE购买了50和100 ORDER BYDER购买ASC