Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. What? Is this a differnet question? I'm confused. Why would you want to change it?
  2. Well, then you'll have to do some fun date math / manipulation to get the first day... get the current year/month, go back one, add the date part ('01'), and then use INTERVAL and BETWEEN.
  3. What "questions" -- you mean homework?
  4. Follow along in this thread.
  5. Assuming your date column is a DATE type, you can use "yourDateColumn >= CURDATE() - INTERVAL 1 MONTH". Of course, that depends on your definiton of "last" and "month".
  6. No index usage... be careful.
  7. Define "used". Also, is "every day" once a day?
  8. Which db version? Post the EXPLAIN.
  9. Why does everyone want to do this? Leave the I/O and memory handling to mysql. See this thread, too. You can't have it in memory only and be reliable.
  10. So comment out all of the php code until it doesn't. Start with the query and anything downstream... just leave the DB connect.
  11. Well, you already have the code for a 4 level join... 3 is no different. Should be ok... You only want left joins if any of the join conditions might be false... in this case, it doesn't sound like it, so inner join is better. And I'm asking all of these questions because you said: I don't understand what this means. Do you want to get this info for all entries (since I don't see a where clause)? Could you give an example of what you get now vs. what you want?
  12. Where does users fit in? Why all the LEFT JOINs? Is this intentional?
  13. That usually means that your data types aren't identical.
  14. Maybe I'm confused about what you're trying to retrieve... with *, you're getting everything.
  15. One is from MySQL AB, the other from Microsoft. Completely different syntaxes, completely different products. Sounds like an easy one for google. To connect from a windows machine, you simply need to install the odbc drivers.
  16. fenway

    mySQL help

    Sounds like it can't connect to your host.... talk to your provider.
  17. 1. mysql doesn't have lists... hence no explode. if you need one, it means you're thinking about sql like a programming language with arrays -- it doesn't have them. 2. one result for what purpose?
  18. fenway

    STR_TO_DATE

    Why are you ordering by a dateformat expression? What do you actually want it sorted by?
  19. Why do you need the left join? And why not switch the 1st and 2nd left joins?
  20. We're going in circles here... you currently have a blank page, right?
  21. mysqludf.com
  22. It's hard to see w/o proper indentation... btw, there's a UDF that does this for you.
  23. You're limiting the number of rows returned, NOT the number of rows considered by the count... if you want the latter, you'll need to derive a table without the aggregate functions, and then use SUM/COUNT on that (untested): SELECT count(*) as cnt, sum(rf) FROM ( SELECT rf FROM mlb_teamgbg WHERE stc = 22 ORDER BY datestamp DESC LIMIT 5 ) AS sub
  24. How can you join something to nothing? One table, no JOIN.
×
×
  • 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.