何我只能获取具有最高cvID值的行?选择具有最高值和加入的行
当前代码
SELECT
CollectionVersionBlocks.cID,
CollectionVersionBlocks.cbDisplayOrder,
CollectionVersionBlocks.cvID,
btContentLocal.bID,
btContentLocal.content
FROM
CollectionVersionBlocks
INNER JOIN btContentLocal
ON CollectionVersionBlocks.bID = btContentLocal.bID
WHERE (CollectionVersionBlocks.cID = 259)
AND CollectionVersionBlocks.isOriginal = 1
AND CollectionVersionBlocks.arHandle = 'main'
AND btContentLocal.content != ''
我想获得该行的底部(其中CVID值为10)。
这是一个更大的结果集的测试语句 -
我最终需要一套从perset CIDS结果(CollectionVersionBlocks.cID = 259 OR CollectionVersionBlocks.cID = 260 ... 800高达)
的更新截图
1)结果太少 2)未分组结果
您正在使用哪些DBMS? Postgres的?甲骨文? –
是否尝试过MySQL(CollectionVersionBlocks.cvID) –
MySQL。尝试了最大值(CollectionVersionBlocks.cvID),但它给了我一个不正确的btContentLocal连接。由于某种原因,它显示了出价349 – v3nt