我有一个包含图像的表格和一个包含图像信息的表格(例如:大小)。Oracle 11g获取不同的多行
**TABLE `images`**
id | name | path | status | changedate
---------------------------------------------
1 | 1.tif | xxx/ | corrected | 2013/03/13
2 | 1.tif | zzz/ | uncorrected | 2013/03/13
3 | 1.tif | yyy/ | corrected | 2013/03/14
4 | 2.tif | zzz/ | correct | 2013/03/29
**TABLE `imageinfo`**
imageid | size
------------------
1 | 100x200
2 | 100x200
3 | 100x200
4 | 127x127
有关信息:可能有超过1张图像具有相同的名称。
我想要得到的领域name
,size
,由name
,status
和changedate
(按此顺序排列)下令图像status
和changedate
。
正如你可以看到它有可能有超过1个同名的图像。我只想要每name
一行,第一行如果有重复的name
图像。
我已经有了:
SELECT
name,
size,
status,
changedate
FROM images
JOIN imageinfo ON images.id = imageinfo.imageid
ORDER BY
name,
status,
changedate
执行的输出:
3 | 1.tif | 100x200 | corrected | 2013/03/14
1 | 1.tif | 100x200 | corrected | 2013/03/13
2 | 1.tif | 100x200 | uncorrected | 2013/03/13
4 | 2.tif | 127x127 | correct | 2013/03/29
需要的输出:
3 | 1.tif | 100x200 | corrected | 2013/03/14
4 | 2.tif | 127x127 | correct | 2013/03/29
这里的一个不同无法正常工作,这就是我已经想通了。 但是如何在Oracle中做到这一点?
你可以添加你的执行输出吗? –
当图像'1.tif'与3种不同尺寸关联时,您如何识别正确的图像尺寸? –
@MaheswaranRavisankar:增加了执行和预期的输出。 – frgtv10