-
Posts
16,168 -
Joined
-
Last visited
-
Days Won
4
Everything posted by fenway
-
How to specify index in the DB query for the string in a column
fenway replied to Pooja11's topic in MySQL Help
You can do magic with SUBSTRING_INDEX and POSITION, but I'm not sure you want to. -
how to search only letters and numbers in tables
fenway replied to jason310771's topic in MySQL Help
You can use REGEXP -- but it won't be very efficient. -
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.
-
Really badly coded PHP MySQL search query (4.1 million for 2500 records!)
fenway replied to jezza52's topic in MySQL Help
Just post the EXPLAIN and we'll see how bad it is. -
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.
- 2 replies
-
- transaction
- ajoo
-
(and 1 more)
Tagged with:
-
Welcome back... it's been a while, but I'm still here ;-)
-
Assuming it truly goes into the "same dropdown", you might get away with some version of UNION.
-
How do i get the last identity for a INSERT Operation calling a SProc
fenway replied to dsscsystems's topic in MySQL Help
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? -
Are you getting that error in the replication thread?
-
Error with mysqli handling NO resultset, not NULL resultset
fenway replied to jugdish114's topic in MySQL Help
Start by posting the actual code for the SP. -
What's mysqldumper?
-
Well, this is the problem -- the DBs need to begin in an identical state in order to begin replication.
-
How did you set up the slave DB to beginwith?
-
Why do you want to do this?
-
Here's to more active gurus!
-
It appears as though you're describing a mysterious tool that you didn't write.
-
FYI, if you're truly using comma-seperated values, FIND_IN_SET() can help too -- not that I recommend this approach.
-
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.
-
We can use all the active gurus around here.
-
When is a Left table 'Left' and a right table 'Right'
fenway replied to vincej's topic in MySQL Help
Agreed -- done. -
I've heard nothing but horror stories about them.
-
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.
-
Well, a scalar subquery, that is.
-
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.