Reputation
3,037
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
12 30
Newest
 Custodian
Impact
~118k people reached

Aug
23
reviewed Reject and Edit Mirroring won't fail back
Aug
23
revised Mirroring won't fail back
added 18 characters in body; edited tags; edited title
Aug
23
revised Find Shoe Size Selection
grammar, spelling, formatting
Aug
23
comment Using Left or substring with wildcard in SQL
Not only your SQL Fiddle example contains more rows, it also contains more different cases. For instance, there is this string: Padding, FLEX 10 400 Series, 11 Stage, BYHMP. What do you want the result for it to be, FLEX 10 400 Series or FLEX 10? I'm trying to understand whether there is always a comma after the number or not.
Aug
22
comment Count the nodes in a binary tree structure
If you are struggling to explain your problem verbally, please try to additionally provide an example that includes both a data sample and the expected output, where the expected output matches the data sample precisely. And please update your question with that information rather then using comments.
Aug
22
reviewed Approve Count the nodes in a binary tree structure
Aug
22
comment Calculate column running total
Yes, SUM() OVER (ORDER BY) is probably the best solution where it's available. However, it would probably be easier to use like this: SUM(amount) OVER (ORDER BY tx_date ASC).
Aug
22
comment MySQL - Ordering 'featured' items first
I've edited your question in an attempt to remove (or at least reduce) any ambiguity. Please take a look, and feel free to edit further or roll back my changes as necessary. Thank you.
Aug
22
revised MySQL - Ordering 'featured' items first
rephrased and added the expected output explicitly, for clarity
Aug
21
answered Generate a list from columns that do not contain a zero for each row
Aug
21
revised Unable to change database owner to a user that is already mapped as user
deleted 4 characters in body
Aug
21
comment How to avoid a “duplicate key” error?
At first I couldn't understand what the downvote was for, but it has now occurred to me that the reason could be this part of the question: "The service generates the record id…" If the service generates the ID, it's unlikely the ID will be used the way your answer assumes.
Aug
21
revised Why is the subquery apparently correlated? How to avoid it?
grammar, spelling, punctuation
Aug
21
comment How to optimise MySQL query that uses dependent subquery
@jkavalik I've heard more than once that in MySQL an anti-join works faster if it's implemented as LEFT JOIN + WHERE IS NULL, rather than as NOT IN or NOT EXISTS, but never realised what was the reason behind it. Your explanation seems to finally clarify that for me (in addition to answering my "dependent" question), thanks.
Aug
21
comment How to optimise MySQL query that uses dependent subquery
What is the dependent subquery that your title is mentioning? I can't see any. The subquery that you do have is not a dependent one, unless I'm misunderstanding what you mean by "dependent".
Aug
20
revised MySQL Escape Characters
fixed a typo, improved formatting and punctuation, added a tag
Aug
20
comment Merge multiple columns into one column in different table?
This probably solves some problem but not the one in this question.
Aug
20
comment Conditional select needed
The easiest solution would seem to be COALESCE((SELECT ...) + (SELECT ...), (SELECT ...)) AS CANT_TOT_DES_SHRED, but the fact that both the second argument's SELECT and one of the first argument's SELECTs read the same table seems somewhat suboptimal. I would probably try and avoid the extra hits by maybe rewriting the correlated subqueries using outer joins.
Aug
20
revised Fractional Transaction Count
typos
Aug
20
comment Ranking refferals
This question has many suggestions on ranking in MySQL.