Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You can do magic with SUBSTRING_INDEX and POSITION, but I'm not sure you want to.
  2. You can use REGEXP -- but it won't be very efficient.
  3. Duplicate should be referring to individual field values, not parts of a field -- storing delimited data that you need to consider separately is likely going to bite you soon enough, if it hasn't already. There's all sorts of tomfoolery you can do with FIND_IN_SET(), but I don't recommend it.
  4. Just post the EXPLAIN and we'll see how bad it is.
  5. Very difficult to tell what you're fererring to -- but I'm assuming that your PHP code isn't actually *making* a table -- DML vs DDL matters.
  6. Welcome back... it's been a while, but I'm still here ;-)
  7. Assuming it truly goes into the "same dropdown", you might get away with some version of UNION.
  8. I'm not certain LAST_INSERT_ID() is meaningful after that last SELECT -- why do you need to get the values you just inserted? Why not do with inside a function?
  9. Are you getting that error in the replication thread?
  10. Start by posting the actual code for the SP.
  11. What's mysqldumper?
  12. Well, this is the problem -- the DBs need to begin in an identical state in order to begin replication.
  13. How did you set up the slave DB to beginwith?
  14. fenway

    ID to GUID

    Why do you want to do this?
  15. Here's to more active gurus!
  16. It appears as though you're describing a mysterious tool that you didn't write.
  17. FYI, if you're truly using comma-seperated values, FIND_IN_SET() can help too -- not that I recommend this approach.
  18. fenway

    join rows

    This is screaming for normalization, but this will work (link to http://sqlfiddle.com/#!2/30c2b/1/0): select id , IFNULL(group_concat(year1),0) as `Year 1` , IFNULL(group_concat(year2),0) as `Year 2` , IFNULL(group_concat(year3),0) as `Year 3` from ( select id , IF(year1,score,null) as year1 , IF(year2,score,null) as year2 , IF(year3,score,null) as year3 from scores ) t1 group by id; Obviously, depending on how you want duplicates and sorting, you'll need to tweak the group_concat() call slightly.
  19. We can use all the active gurus around here.
  20. The more the better.
  21. I've heard nothing but horror stories about them.
  22. Covers: Part 1: Using the MySQL Improved Extension, mysqli Part 2: Using the MySQL Extension, mysql Part 3: Using the PDO Extension With MySQL Driver, pdo_mysql Part 4: Using the MySQL Native Driver for PHP, mysqlnd Tutorial is here.
  23. Well, a scalar subquery, that is.
  24. Hopefully this presentation will stay online at scribd... it's simply fantastic, probably the best I've come across in recent memory. At 220 slides, it's quite lengthy -- but the lessons learned are invaluable, so be sure to read all the way to the end. A MUST READ!!!! EDIT: This year's version of the presentation -- some really great stuff in here, particuarly about hierarchies.
×
×
  • 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.