Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Guidance with what?
  2. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=347816.0
  3. What's not clear is if you want someone to write your script or if there's just one aspect that's presenting difficulty.
  4. That doesn't answer the question
  5. I don't understand the question -- just keep everything.
  6. You can also order by the expression ( premium = 1 ).
  7. Doesn't work How?
  8. I don't believe you.
  9. That doesn't answer the question.
  10. You need to add: songs.yourDateField > NOW() - INTERVAL 10 DAY To the WHERE clause.
  11. How come sta isn't 165?
  12. That depends on how much of your data you want back if it crashes.
  13. "previous row" has no meaning to a dataase.
  14. Easy to check -- use LOCATE().
  15. If you have an index on that field, then : SELECT `field` FROM `table` WHERE `datefield`>= 'YYYY-MM-DD'; Is better.
  16. Well, replacing IN() with a JOIN is likely going to show improvement. Beyond that, I'll need to see EXPLAIN output.
  17. Yup, the previous comments were correct -- you're dealing with a hierarchy here. If you would store the "depth" when you store the original data, life would be easy.
  18. I'm sorry, you want to do what/
  19. Why do you have "FROM" twice?
  20. Well, the order by is redundant, since group by orders automatically -- and typically you'd use the aggregated value alongside the count, like so: SELECT hour( `datetime_added` ) AS addedHour , count(*) AS cnt FROM `requests` GROUP BY hour( `datetime_added` ) But they're functionally equivalent.
  21. You can group by HOUR(yourDateField).
  22. If you have the solution, then post it. "nevermind" won't help anyone but you.
  23. Nothing wrong with the line break -- but unless you're getting a mysql error, you have some other, non-DB problem.
  24. Are you saying that you don't get back 2 records?
×
×
  • 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.