我有两个表Sizes_description(衣服尺寸)和库存数量。我想知道有哪些尺寸的库存。如果我尝试以下查询,我还会得到没有库存的尺寸。
| SIZES_DESCRIPTION |
-----------------------
id size1 size2 size3
-----------------------
1 M L X
2 40 42 43
-----------------------
-----------------------------
| STOCK |
-----------------------------
id sizeId qty1 qty2 qty3
-----------------------------
1 2 0 5 0
2 1 42 43 0
-----------------------------
如果我尝试以下方法,我也会得到没有库存的尺寸
select s.size1,s.size2,s.size3 from SIZES_DESCRIPTION as s, stock as stock WHERE s.id=stock.sizeId AND (stock.qty1>0 OR stock.qty2>0 OR qty3>0)