Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. But that precludes using DB date values....
  2. As in: ORDER BY FIELD( product_line, 'Jewelry', 'Automotive' ) Just be aware that this assigns a value based on the 1-indexed position in the list you provided -- non-matching results will get a value of 0 --- so if you have non-matches, then flip the order: ORDER BY FIELD( product_line, 'Automotive', 'Jewelry' ) DESC, product_line
  3. There is a FULLTEXT search...
  4. ALL? Bad idea...
  5. You need to first use a query to get the most recent (e.g. with MAX(yourDateField) and GROUP BY), and then JOIN this derived table to the parent table.
  6. Please echo $sql.
  7. Or you can get really fancy (read: bad idea) by SELECTing the desired query INTO a user variable and then executing it.
  8. If that's the case, you can use the FIELD() expression in the ORDER BY clause... just like the same order (unless there will be results that don't match).
  9. File? No file... issue the appropriate GRANT statements... or better yet, see what permissions you actually have.
  10. Just make sure you don't select "*" -- or include the TEXT field in any group-by / potential filesort operators -- and you'll be fine.
  11. DISTINCT is almost always the wrong modifier.
  12. Not it IE... which is a bug I had to fixes on someone else's website who never bothered to check the site in Firefox. Yeesh.
  13. Why is that any easier?
  14. Why so many separate queries?
  15. And I really hope you don't mean to store "4:00pm" as text.
  16. What is the input to your quey?
  17. Why not this? SELECT club, MIN(r.besttime) FROM ( SELECT r.club, r.besttime, r.date, DATEDIFF( MAX( r.date ) , MIN( t.date ) ) AS diff FROM racing r INNER JOIN tournament t ON ( t.enumber = r.event ) WHERE t.date >= '2007-01-01' AND r.besttime < 99.999 GROUP BY r.club HAVING diff > 4 ) AS sub WHERE r.date >= '2007-08-01' GROUP BY club
  18. There are other types of GRANT permissions, not just "access".;
  19. How do you know where to start (up or down)?
  20. I will echo the previous comment about COUNT(*) and InnoDB -- have a summary table.
  21. Yeah, LOAD DATA INFILE is the only way to go.
  22. Not sure what you're trying to do here... seems like you could do it all at once, with a JOIN... but you're returning non-GROUP BY'ed columns in the first query.
  23. You can't do that, because you can't index across tables.
  24. Then DAYOFWEEK(FROM_UNIXTIME(eday)) is the expression you want.
×
×
  • 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.