Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by fenway

  1. Thanks, my first thought was to put it all in one join statement. But I order by total points to determine the rank so how can I determine the rank of the total points from 7 days ago in the same statement?

    Again, you haven't told us what you're trying to -- you're telling us why what you're written doesn't work.

  2. I think I'm getting somewhere.  I run this direct on the database (just basic queries with no extra stuff added):

    SELECT id FROM ((SELECT id FROM TABLE1) UNION (SELECT id FROM TABLE2))

     

    I get this:

    Every derived table must have its own alias

     

    Also, why the extra select at all?

  3. This isn't a new problem -- but there's no reliable solution.  At some point, you're going to have to create a mapping from companyN to your internal naming convention for each product X -- there's really no way about it.

     

    If N is small, then even if X is large, deltaX -- the number of products that (a) change names or (b) are added [deleted doesn't count] -- is likely to be small as well.

     

    The initial mappings will be painful -- but a multi-pass approach should reduce the workload by about 95%.  Afterwards, it's a one-off, which is easy to get a client to do. 

  4. :(

    just tell me

     

    I never worked with mysql

     

    Why should we 'just tell you' -- this is site for people to exchange ideas -- not a site to demand answers.

     

    If you really don't understand these comments, then this isn't your script.  Which means you shouldn't be changing it without understanding how it works.

  5. "SELECT clan1.name AS clan1Name, clan2.name AS clan2Name
    FROM ".PREFIX."cup_matches AS matches 
    INNER JOIN SELECT name FROM ".PREFIX."cup_all_clans` AS clan1 ON ( clan1.ID = matches.clan1 )
    INNER JOIN SELECT name FROM ".PREFIX."cup_all_clans` AS clan2 ON ( clan2.ID = matches.clan2 )
    WHERE matches.cupID=$cupID"

    Should do the trick.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.