Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Well, that's 50 times more overhead (client/server, result set object creation/deletion, etc.) -- but it really depends on how many rows match, how much data are returned, etc.
  2. "Array" is coming from php as the object type... so you *are* trying to insert an array.
  3. fenway

    results

    Try: SELECT value1, value2, (value1 * value2 ) AS x FROM test_oh HAVING x >= 300
  4. You can test the effect of this using asking for "yourColumn+0" in the select column list... it will likely get truncated at the first non-numeric character.
  5. Not at all. NULL means an undefined value -- for example, if you ask someone to fill out a form with the question "how many brothers do you have?", and make the question optional, then you need a way to differentiate between "I have no brothers" vs. "I didn't answer the question". This is the difference between 0 and NULL; the same can be said for a question like "favourite pet", where it would be the different between '' (no such pet) and NULL (I didn't answer). Hope that helps.
  6. Why not just join the domains table again? Why the subquery?
  7. You will have to build up your where clause in PHP, only adding the columns where data has been entered
  8. SELECT r.cyclist FROM info AS i INNER JOIN riders AS ON ( r.id = i.rider_id ) WHERE i.rider_id = '$rider_id' ORDER by i.date Though I would change the name of your date field, since DATE is a reserved keyword.
  9. I don't know what you mean by "create group" in the sql sense.
  10. Yikes... first, don't double-post. Second, what format?
  11. Or you could ignore my suggestion.
  12. fenway

    Normalization

    There are some excellent stickies on DB normalization.
  13. Why? Just post your solution instead.
  14. That's impossible.
  15. You just need to you SUM(IF(yourColumn='yourValue'),1,0).
  16. Sounsd like you need a left join
  17. How are you detemining these numbers?
  18. Seriously? 43 tables? At the very least, a covering index on (sex,age) would be helpful... but what's with all the impossibles?
  19. Post your table structure, and a sample of the output you want to see.
  20. What is the problem?
  21. LAST_INSERT_ID()?
  22. That's about as good as you can get... unless you've picked the wrong sized column types to index.
  23. You've tried this and this already?
  24. Post the EXPLAIN output to make certain that you've done that correctly.
×
×
  • 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.