-
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.
-
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.
-
MySQL query SELECT statement not functioning as expected
fenway replied to Skorpio's topic in MySQL Help
Why not just select topic, sub_topic? -
find nearby location using zipcode lookup within certain radius
fenway replied to rashgang's topic in MySQL Help
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. -
Sure, you can query a database for a column value -- but I'm assuming your question is more complicated than that? Please elaborate.
-
You can also use +0.