Didn't tried Werzel's queries. I don't really understand "scroreboard a" and "scroreboard b". Do I have to create another table by duplicating the 1st one?
EDIT: Ok it seems that I have to create a temporary table. Found that in SQL doc:
More explanation on french version:
Last edited by Olivier; 07-16-2006 at 11:59 PM.
You don't have to create another table. I wrote the queries so you can copy and paste them directly into your code and they should run.
Originally Posted by OliverPearl.com
If you're interested (and they work for you), I can explain them in more detail.
Thank you very much Werzel, both your queries work perfectly. First I have overlooked them, sorry for that. I think we have SQL experts here!
Werzel I think I understood that your queries were also using a subquery, but I'd be happy if you could explain them a bit more. The "scroreboard a" and "scroreboard b" parts especially, I couldn't find my way in the doc.
I really envy you for not knowing SQL.. it means you don't earn your living building boring database applications
The 'scoreboard a' and 'scoreboard b' are aliases. They are a means of making a query with a table joined to itself and the 'a' and 'b' are simply a means to identify which 'instance' of the 'scoreboard' table you are referring to. You can think of them as temporary in-memory copies of the same table that MySql uses to build the query.
Sometimes I wish I have greater knowledge in lots of domain, databases included now that I develop games/websites that uses them.
Thank you Sharkbait for your explanation, temporary in-memory copies - it's clear now.