ORACLE存储多表关联造成查询的数据由单条变多条
SELECTCOUNT(1)FROMSPS_VESSEL_STORAGES,SPS_VESSEL_STORAGE_SNAPSHOTSSWHERES.PARTS_INFO_...
SELECT COUNT(1)
FROM SPS_VESSEL_STORAGE S,SPS_VESSEL_STORAGE_SNAPSHOT SS
WHERE S.PARTS_INFO_ID=SS.PARTS_INFO_ID
起初两张表关联着中间表(关联的id有6条),本来SPS_VESSEL_STORAGE_SNAPSHOT 这张只有一条数据,我执行完count=6;我实际上想得到一条,怎么做条件限制? 展开
FROM SPS_VESSEL_STORAGE S,SPS_VESSEL_STORAGE_SNAPSHOT SS
WHERE S.PARTS_INFO_ID=SS.PARTS_INFO_ID
起初两张表关联着中间表(关联的id有6条),本来SPS_VESSEL_STORAGE_SNAPSHOT 这张只有一条数据,我执行完count=6;我实际上想得到一条,怎么做条件限制? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询