Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Forget about the other columns for a minute... just write the simplest group by.
  2. Well, if you wanted the "top 6", you could simply self join with a group by & having clause...
  3. So what's the difference between the dbs?
  4. If you're going to mark a topic "solved", then please post the solution for the benefit of others.
  5. Sorry, Mchl caught an earlier mistake... you only need a key on the column you're joining.
  6. Why do you need such a function? Simply split the string to parts and run a for loop....
  7. Then you didn't follow it correctly... I don't see anything generating the column names you want, nor checking their values.
  8. No, that's the opposite... and why are you mixing curdate and now?
  9. Then please post the solution as mark the topic "solved".
  10. Yes, sorry, good catch -- it's really late in EST.
  11. Why not NOW() BETWEEN start AND end ? (obviously, it's better to expand that for index usage )
  12. Mysql doesn't have any idea what a url parameter is... php can be used to write mysql statements.
  13. Why not write a multi-table update?
  14. Sounds like a freelanching request....
  15. You may want to read this thread. SELECT pc.product FROM pc as t1 CROSS JOIN pc as t2 USING ( id ) WHERE pc.category = 'plastic' and pc.category = 'tall' Obviously, if you don't have an id field, you should use USING ( product, category ) -- and have a combined index. Hope that helps.
  16. Ignoring the normalization issue, the "real" problem if that you can't specify column names dynamically in mysql statements. So you'll need to determine which seat is available "next" -- trivial to do with a single statement, which you can then "pipe" to your update statement (since obviously insert isn't what you want).
  17. This comes up over an over again -- you either need to keep track of what moved, or just re-order them.
  18. Hmm, i think you need double-quotes to search for it as a phrase.... Yes, but that's not the point, since it's over two columns... use '+John +Smith' instead.
  19. First you need to group by to find the single row per group that you're interested in -- then you need to join it back to the rest of the DB.
  20. Not than any of the data in the mysql table is likely to be anything other than text...
  21. Wait, you want to do what?
  22. What about mysql.connect_timeout in your php.ini file?
  23. I'm fairly sure the mysql refman page on this topic describes where to find it... I don't recall.
  24. Um, no. SELECT * FROM admin AS a INNER JOIN workorders USING ( AdminID ) WHERE a.Key1 = 'YES' But I realy hope you're not doing all of that just for a count!
  25. Yes, something very important... the values in the other columns can come from *ANY* of the aggregated rows -- not necessarily the same ones!
×
×
  • 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.