Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. I would ask why this would ever be necessary (or why they were mixed/upper to begin with), but I'm sure I don't want to know that answer.... just issue a SHOW TABLES and run the necessary alter for each.
  2. Not sure which part is causing problems for you... there's a lot going on there.
  3. 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).
  4. I've no idea what you've done... but you have a union...
  5. SELECT count(*) as num FROM c5t_comment WHERE comment_identifier='/hotels/anglo.php' AND comment_status = 0
  6. Don't use php based counters.
  7. 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 )
  8. Right... but you wouldn't have a second 1002/2 row if the unique index was present.
  9. 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!
  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. 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.
  21. MySQL has substring() function too....
  22. FYI, InnoDB is much slower that MyISAM for typical web applications.
×
×
  • 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.