+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 31 to 35 of 35

Thread: PHP/SQL Highscores, avoiding duplicate entries

  1. #31
    Senior Member
    Join Date
    Mar 2005
    Location
    Oliver Pearl Studio
    Posts
    460

    Default

    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:
    http://dev.mysql.com/doc/refman/5.0/...group-row.html
    More explanation on french version:
    http://dev.mysql.com/doc/refman/5.0/...group-row.html
    Last edited by Olivier; 07-16-2006 at 11:59 PM.
    OliverPearl.com - My Shapes iOS - CrazyCrab iOS - Bonbon Quest
    Social - #OliverPearl - FB - YT - Blog

  2. #32
    Junior Member
    Join Date
    Sep 2005
    Posts
    9

    Default

    Quote Originally Posted by OliverPearl.com
    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?
    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.

    If you're interested (and they work for you), I can explain them in more detail.

  3. #33
    Senior Member
    Join Date
    Mar 2005
    Location
    Oliver Pearl Studio
    Posts
    460

    Default

    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.
    OliverPearl.com - My Shapes iOS - CrazyCrab iOS - Bonbon Quest
    Social - #OliverPearl - FB - YT - Blog

  4. #34

    Default

    Oliver,

    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.

  5. #35
    Senior Member
    Join Date
    Mar 2005
    Location
    Oliver Pearl Studio
    Posts
    460

    Default

    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.
    OliverPearl.com - My Shapes iOS - CrazyCrab iOS - Bonbon Quest
    Social - #OliverPearl - FB - YT - Blog

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts