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. 1. I see no reason to not use DECIMAL -- no need to worry about floating-point errors in recent versions of MySQL. 2. Never store formatted data -- you can always format it on the way out.
  22. Why not just select topic, sub_topic?
  23. Also, it's rare that you need the exact distance -- pythagoras does a better faster job anyway. You can't drive straight-line distance anyway.
  24. Sure, you can query a database for a column value -- but I'm assuming your question is more complicated than that? Please elaborate.
  25. You can also use +0.
×
×
  • 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.