0

我有这个查询:

SELECT tag, filename, timecode, COUNT(tag) AS total 
FROM dados 
WHERE dados.tag = 'movie' 
AND dados.filename = 'movie2.mp4' 
GROUP BY timecode

这是结果:

但我只想要第 3 行,更准确地说是 timecode=2,因为它是具有较高值的​​最组成的标签。我怎样才能从这些行中获取时间码的最高值?

4

1 回答 1

0

ORDER BY与_LIMIT

SELECT tag, filename, timecode, COUNT(tag) AS total 
FROM dados 
WHERE dados.tag = 'movie' 
AND dados.filename = 'movie2.mp4' 
GROUP BY timecode
ORDER BY COUNT(tag) DESC
LIMIT 1
于 2012-08-24T21:30:48.730 回答