1. Play on the ImDeity Minecraft Multiplayer server -- Goto the "Multiplayer" section of Minecraft and type "mc.imdeity.com" to join!
    Dismiss Notice

Comments on Profile Post by KILL3RTACO

  1. vanZeben
    vanZeben
    Efficiency > Character Count. Although it would be nitpicky, you shouldn't really be doing selects in your order by like that, select it all at once and then order by what you need... Something like: http://pastebin.com/raw.php?i=Rx3wRqVr if I understand what you're going for at all...
    November 18, 2013
  2. KILL3RTACO
    KILL3RTACO
    Even using that approach I would need to use a subquery if I want to order the list by the last action (in this case likes) because LAST() as a function needs a workaround MySQL
    November 18, 2013
  3. KILL3RTACO
    KILL3RTACO
    Also, this seems to only get one entry lol, I need multiple
    November 18, 2013
  4. KILL3RTACO
    KILL3RTACO
    The goal of the query is to sort all players by the amount of likes they have, and then again by the time of their last like (LIMIT 10 or something is gonna be appended at the end of course)

    And I wasn't saying the query was awesome cause of the length, just that I've never really used subqueries and aliases before
    November 18, 2013
  5. vanZeben
    vanZeben
    November 18, 2013
  6. KILL3RTACO
    KILL3RTACO
    That's a bit better, all it needs now i guess is a check to see if l.owner matches a plot's owner (with the plot's id being l.plot_id)

    I accomplished that with a subquery, ... AND l.owner = (SELECT `owner` FROM plot_table WHERE `id`=l.`plot_id`) problem is, its used twice. Which bugs me
    November 19, 2013
  7. vanZeben
    vanZeben
    November 19, 2013
  8. KILL3RTACO
    KILL3RTACO
    Hm.. more simple than i'd thought it would be
    November 19, 2013
  9. KILL3RTACO
    KILL3RTACO
    And lol sorry if it seemed liked if you were doing my homework or something xD
    November 19, 2013
  10. KILL3RTACO
    KILL3RTACO
    derp, and MAX(time) fixes my issue of the "last action" thing, GREAT :D
    November 19, 2013
  11. melvin484
    melvin484
    so
    much
    smart
    November 20, 2013
  12. vanZeben
    vanZeben
    No it's not that, SQL can be tricky and deity passed his knowledge (kinda), onto myself, and now I pass it to you :) You should be able to extrapolate the concept behind it for sql in general, it's a very very powerful language
    November 20, 2013
  13. KILL3RTACO
    KILL3RTACO
    Yeah, I learned about the alias thing like not even a week ago. And from this I learned you can actually SELECT from multiple tables
    November 20, 2013