|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
各位今天我在进行库存现有量查询的时候,检查了一下系统所用的查询语句,不太清楚的是条件之中有: WHERE 1 = 0
这样的语句,请问出现这样的条件有什么原因吗?- SELECT ORGANIZATION_ID,
- ORGANIZATION_CODE,
- SUBINVENTORY_CODE,
- LOCATOR_ID,
- LOCATOR,
- PROJECT_ID,
- TASK_ID,
- INVENTORY_ITEM_ID,
- ITEM_DESCRIPTION,
- ITEM,
- UOM,
- REVISION,
- ON_HAND,
- UNPACKED,
- PACKED,
- COST_GROUP_ID,
- LPN_ID,
- LPN,
- LOT_NUMBER,
- SERIAL_NUMBER,
- UNIT_NUMBER,
- PLANNING_ORGANIZATION_ID,
- PLANNING_TP_TYPE,
- OWNING_ORGANIZATION_ID,
- OWNING_TP_TYPE,
- SUBINVENTORY_STATUS_ID,
- LPN_CONTEXT,
- ITEM_LOT_CONTROL,
- ITEM_SERIAL_CONTROL
- FROM MTL_ONHAND_DUMMY_V
- WHERE 1 = 0
- UNION ALL
- SELECT organization_id,
- organization_code,
- to_char(null) subinventory_code,
- to_number(null) locator_id,
- to_char(null) locator,
- to_number(null) project_id,
- to_number(null) task_id,
- inventory_item_id,
- item_description,
- item,
- uom,
- to_char(null) revision,
- sum(on_hand) on_hand,
- sum(unpacked) unpacked,
- sum(packed) packed,
- to_number(null) cost_group_id,
- to_number(null) lpn_id,
- to_char(null) lpn,
- to_char(null) lot_number,
- to_char(null) serial_number,
- to_char(null) unit_number,
- planning_organization_id,
- planning_tp_type,
- owning_organization_id,
- owning_tp_type,
- to_number(null) status_id,
- to_number(null) lpn_context,
- item_lot_control,
- item_serial_control
- FROM MTL_ONHAND_TOTAL_MWB_V
- WHERE 1 = 1
- AND inventory_item_id = '966660'
- AND organization_id = '143'
- GROUP BY organization_id,
- organization_code,
- inventory_item_id,
- item_description,
- item,
- uom,
- planning_organization_id,
- planning_tp_type,
- owning_organization_id,
- owning_tp_type,
- item_lot_control,
- item_serial_control
- HAVING 1 = 1
- UNION ALL
- SELECT organization_id,
- organization_code,
- subinventory_code,
- locator_id,
- locator,
- project_id,
- task_id,
- inventory_item_id,
- item_description,
- item,
- uom,
- revision,
- on_hand,
- unpacked,
- packed,
- cost_group_id,
- lpn_id,
- lpn,
- lot_number,
- serial_number,
- unit_number,
- planning_organization_id,
- planning_tp_type,
- owning_organization_id,
- owning_tp_type,
- subinventory_status_id,
- lpn_context,
- item_lot_control,
- item_serial_control
- FROM mtl_onhand_dummy_v
- WHERE 1 = 0
- order by ITEM, ORGANIZATION_ID, SUBINVENTORY_CODE, LOCATOR
复制代码 |
|