TOP 10 is access database..
Med venlig hilsen
/Jokke Jensen
www.jj-multimediedesign.dk
Best regards
Fredrik
Hello!
Thanks for all help but I had to solve it with 2 separate questions. I really thougt that I should be able to combine them, but no.
SELECT competition_id, max(votes), startdate, stopdate
FROM competitors, competitions
WHERE
site_id = ?
AND
competitions.id = competition_id
AND
competitions.stopdate < ?
GROUP BY
competition_id
ORDER BY startdate DESC;
SELECT competitors.id, competitors.name, competitors.description, customers.name
FROM competitors, customers
WHERE
competition_id = ?
AND
votes = ?
AND
customers.id = competitors.customer_id
ORDER BY
competitors.name;
I use it from preparedstatements in Java, the ? is changeable parameteres.
Best regards
Fredrik
BTW it is a MySQL 3.23 And booth of you should give me "svar" so I can reward you all!