Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Not sure which part is causing problems for you... there's a lot going on there.
  2. You can use user variables for "row-based" counts/sums. As for the import, I assume it's CSV-able, and mysql actually has such a table type (or LOAD DATA INFILE from any tab-separated file).
  3. I've no idea what you've done... but you have a union...
  4. SELECT count(*) as num FROM c5t_comment WHERE comment_identifier='/hotels/anglo.php' AND comment_status = 0
  5. Don't use php based counters.
  6. fenway

    T-SQL

    Yeah, no kidding, I had do some reporting and to get the DATE part of a DATETIME field I had to do this: SUBSTRING( CONVERT(varchar, l.triggered_on, 20 ), 1, 10 )
  7. Right... but you wouldn't have a second 1002/2 row if the unique index was present.
  8. fenway

    GROUP_CONCAT

    Hmmm... maybe all aggregate function always return a single row, like count, sum, avg, etc... and group_concat behaves like one of these too!
  9. Look it up first...
  10. TABLE AS ALIAS. hwz_postcodes AS dest
  11. Varibles? No variables... it's TABLEALIAS.COLUMNNAME.
  12. I don't really see how that could be much better... not sure I understand that new column you made.
  13. You're passing the entire php line to mysql... there's an assignment!
  14. fenway

    GROUP_CONCAT

    NULL row? From just a single table? Sounds implausible... and select * doesn't give you a null row?
  15. You can have a unique index that spans multiple columns...
  16. Matters to everyone else other than you... how?
  17. That won't work because you have php code in your sql statement. You need to convert that php code into the equivalent sql code with SUBSTRING() and LOCATE().
  18. fenway

    GROUP_CONCAT

    What do you mean? If there's no match, you shouldn't get any rows back, group_concat() or not...
  19. You're using != , so no index... inner join is probably what you want vs. left, and order by rand() is poor as well.
  20. No idea... post the EXPLAIN
  21. Replace each comma with the words "INNER JOIN", then move each corresponding WHERE clause portion to an ON clause. But it won't be any faster, just easier to read.
  22. MySQL has substring() function too....
  23. FYI, InnoDB is much slower that MyISAM for typical web applications.
  24. fenway

    GROUP_CONCAT

    Ah yes, I forgot about that bug... came across that one a long time ago while using an ODBC driver using an older version of the connector (not that I can find any refererence to it anymore). Apparently, it gets confused and "forgets" to stringify it.
×
×
  • 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.