Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. If it's still an issue, the post the new output, they expected output, and I'll take a closer look.
  2. fenway

    Mysql versions

    http://dev.mysql.com/doc/refman/5.0/en/stored-routines.html
  3. That because you need to group by the YEAR_MONTH as well -- so simply alias that column, and all it to the GROUP BY clause.
  4. I see nothing special about any of those characters. What's more, you MUST escape every string to send to mysql.
  5. No, the problem you're having is with the dates -- because you've turned one column into two. EXTRACT(YEAR_MONTH FROM yourDate).
  6. Link how?
  7. Yes it does, they are usually no longer distinct if you add that column Not Distinct: 1, table1 1, table2 removing what table they came from make them distinct You're missing the point --- MySQL is still running DISTINCT, and wasting it's time. The fact that you might want to know what table they originated from is not the issue.
  8. http://php.net/manual/en/mysqli.insert-id.php
  9. That has absolutely nothing do with with the "missing" rows -- they're missing because they're not distinct. MySQL thinks it's doing you a favour. That will indirectly make them non-distinct -- but that's not robust.
  10. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=352952.0
  11. UNION is implicitly UNION DISTINCT. If you don't want that, use UNION ALL.
  12. Instead of grouping by the date parts separately, simply use YEARMONTH(), and then you can format it on output.
  13. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=352947.0
  14. I'm confused by your design -- and why you're using non-aggregated fields in your SELECT list.
  15. I just noticed your ID is a timestamp? Bad idea. Use a surrogate key -- BIGINT UNSIGNED AUTO_INCREMENT -- as the primary key. Make another column for the timestamp.
  16. There must be dozens of WAMP installation tutorials out there.
  17. I'm confused about your choice of key -- and so is mysql.
  18. DISTINCT will be very slow on large datasets.
  19. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=352821.0
  20. That means something is wrong, through -- have you tried to run ANALYZE TABLE, and then remove the STRAIGHT_JOIN?
  21. Sorry, switch the order of the tables.
  22. What's giving you these errors?
  23. Why is this even an SP?
  24. Not sure why mysql wants to scan tariff table first.... seems wrong. Try using STRAIGHT_JOIN.
  25. Yeah, wordpress has no idea how to write proper mysql queries.
×
×
  • 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.