【发布时间】:2019-04-09 11:26:18
【问题描述】:
我正在尝试返回在子查询中计数时“SKU_ID”大于 1 的行。
我面临的问题是,当我独立运行子查询时,它会按预期返回行。但是,当我将 in 作为 where 子句的一部分使用时,会出现以下错误:
ORA-01722: 无效号码 01722.
*原因:指定的号码无效。
*Action:指定一个有效数字。00000 - “无效数字”
我尝试了以下...
SELECT inventory.sku_id, inventory.location_id, inventory.qty_on_hand, inventory.tag_id, inventory.full_pallet, sku_config.ratio_1_to_2 as "FULL QTY"
FROM inventory
JOIN sku_sku_config ON inventory.sku_id = sku_sku_config.sku_id
JOIN sku_config ON sku_sku_config.config_id = sku_config.config_id
WHERE inventory.sku_id in
(SELECT count(*)
FROM inventory
JOIN sku_sku_config ON inventory.sku_id = sku_sku_config.sku_id
JOIN sku_config ON sku_sku_config.config_id = sku_config.config_id
WHERE zone_1 NOT LIKE 'PROD' AND lock_status = 'UnLocked' AND full_pallet = 'N'
GROUP BY inventory.sku_id
HAVING count(*) >= 1)
【问题讨论】: