我在我的数据库上运行一个非常简单的SQL查询,它似乎一遍又一遍地返回相同的记录,创建一个无限循环.也许我错过了一些明显的东西,但我没有看到它.这是查询:
select s.customer as 'Customer',
s.store as 'Store',
s.item as 'Item',
d.dlvry_dt as 'Delivery',
i.item_description as 'Description',
mj.major_class_description as 'Major Description',
s.last_physical_inventory_dt as 'Last Physical Date',
s.qty_physical as 'Physical Qty',
s.avg_unit_cost as 'Unit Cost',
[qty_physical] * [avg_unit_cost] as Value
from database.DELIVERY d,
database.STORE_INVENTORY s,
database.ITEM_MASTER i,
database.MINOR_ITEM_CLASS mi,
database.MAJOR_ITEM_CLASS mj,
database.STORE_INVENTORY_ADJUSTMENT sa
where sa.store = s.store
and s.last_physical_inventory_dt between '6/29/2011' and '7/2/2011'
and s.customer = '20001'
and s.last_physical_inventory_dt is not null
Run Code Online (Sandbox Code Playgroud)
有一条记录落在2011年7月1日,它会一直重复,直到我取消查询.
有什么帮助防止这种情况?
| 归档时间: |
|
| 查看次数: |
4767 次 |
| 最近记录: |