Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You mean trigger into another table, or the same table?
  2. Don't mix DISTINCT and GROUP BY -- that's misleading and error-prone. You can group by both columns.
  3. Your table is just SCREAMING for a UID.
  4. Have you started this project yet? If not, these three shouldn't be your primary concern.
  5. Everything matters -- either it's the SQL statement (a string) or the query handle (an object).
  6. Then you're not storing IPs correctly.
  7. You really should always have a password for root.
  8. Height as an ENUM field? Bad idea. Height as a VARCHAR? Bad idea.
  9. Well, if I have the time, I'll either solve it again, or find the original post with the solution.
  10. No need for subquery -- really, just a CROSS-JOIN for each attribute -- it's not a complex query.
  11. You need to isolate a unique group first, and then join upwards.
  12. Learning SQL is like learning English -- don't bite off more than you can chew.
  13. You should NEVER need to retrieve the password.
  14. Well, you're not supposed to store delimited data when you (a) aren't storing individual elements of an array and (b) need access to an arbitrary element. You're missing some tables. And SUBSTRING_INDEX() can help you if the want the "inside".
  15. Oh, I really like that idea! +1
  16. You need to cross join, once for each attribute.
  17. Well, yes, if you self-join the table, and ensure increasing UID order with (> in the ON clause), you'll get tuples for each pairing of login times. But that's not very helpful. You could achieve some magic with user variables, though.
  18. Yeah, but mixing DISTINCT, *,and GROUP BY is likely very bad.
  19. You're mixing AND and OR -- probably not how you expect -- you're missing parentheses. IN() solves this nasty oversight. Also, assuming your 'deleted' column is rare, an index on that column might help too, since now EXPLAIN shows 'all' for the `xfiles` table.
  20. Raw query as in non-active records? Sorry for the delayed response -- no, raw query as in the actual SQL statement being sen to the server.
  21. Sorry about the delayed response -- I don't understand the question.
  22. You don't have to log this in the DB -- but if you do so, just use INSERT DELAYED.
  23. Again, post the EXPLAIN output.
  24. I don't see a raw query.
×
×
  • 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.