1
嘿,我不是最大的專家與MySQL,但這裏是我迄今爲止獲得的最大entery使用MySQL來選擇最後5個條目的SUM的最大值?
SELECT DISTINCT
websites.id,
websites.title,
websites.url,
websites.screenshot,
impressions.number,
blocks.price
FROM websites
LEFT JOIN blocks ON websites.id = blocks.website
LEFT JOIN impressions ON blocks.id = impressions.block
WHERE status = 1
AND blocks.active = '1'
AND impressions.number = (SELECT MAX(number)
FROM impressions)
我想要做的是選擇最大(數目)的總和,但最後5個條目。我嘗試過亂搞,但無法得到它。
最後五個基於什麼? – 2011-05-05 23:56:30
@OMG小馬,我猜最後五個印象。 – 2011-05-06 00:20:02