Reputation
1,849
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
7 21
Newest
 Yearling
Impact
~87k people reached

Jan
24
comment Can I manage NULL = 'SomeDefault' in the database so applications and SQL don't have to remember this optimization?
Maybe you could achieve some result with the help of functions NULLIF and either IFNULL or COALESCE, but the way I imagine you would likely use them you would certainly kill the performance. Consider rewriting your question by adding the underlying problem to it (presumably the one you've mentioned in your comment, except you may want to elaborate on it a little, as it doesn't seem very clear at the moment).
Jan
15
revised Is it possible to emulate the WITH command in MySQL 5.1.73?
clarified
Jan
15
revised Is it possible to emulate the WITH command in MySQL 5.1.73?
added 427 characters in body
Jan
15
answered Is it possible to emulate the WITH command in MySQL 5.1.73?
Jan
14
comment How to properly aggregate?
Doesn't seem entirely clear what the result is supposed to be. Could you add a data sample and the expected result for it to illustrate the problem?
Jan
2
comment What is the most efficient method of performing the FIZZBUZZ test in SQL Server?
We are still not on the same page, it seems. Just as you could rewrite stupidalias2 as a CTE, you could also do the same with stupidalias1 or, for that matter, with any of n0, n3, n9 etc. It would be just a syntax change and no challenge – that was the idea I (and probably Aaron too) tried to get across. In short, it wouldn't matter much really, it's just that your statement (Doesn't use any CTEs) does seem a bit on the negative side.
Jan
2
comment What is the most efficient method of performing the FIZZBUZZ test in SQL Server?
Not sure but it seems like by CTE you mean specifically a recursive CTE, even though the thing doesn't have to be recursive to be called "a CTE". And a non-recursive CTE (which I'm sure is what @Aaron was talking about) is almost the same thing as your "normal" subselect (it would be the same in this case anyway), you just use a slightly different syntax to declare it: instead of ... left outer join (select 3 as fizzstep, 'Fizz' as fizz) as stupidalias2 on ... you go with stupidalias2 as (select 3 as fizzstep, 'Fizz' as fizz) ... left outer join stupidalias2 on .... That is no challenge.
Dec
29
revised Sum of two columns from pivot
currected variable names
Dec
15
revised Why can't I use a CASE statement to see if a column exists and not SELECT from it?
corrected grammar for better clarity
Dec
7
comment T-SQL View — How to 'pre-fetch' schema using scalar function, then populate using table query
I'm not entirely sure what you want here but it looks a little as if SET FMTONLY might be of help.
Nov
6
comment Best design to handle multiple query keys
@MinimeDJ: But if it's an "everything in one table" approach in particular, then it very likely will.
Oct
29
revised Query optimizer recommends adding index instead of using existing index
fixed typos
Oct
29
suggested approved edit on Query optimizer recommends adding index instead of using existing index
Oct
25
comment Re-writing a sub-select as a condition on a column generated with 'over (partition by …)'
What do you mean by "no subselects"? Does select ... from (select ... from (select ... from ... qualify as no subselects?
Oct
11
revised Very slow response even with a high number of available connections
formatting, grammar, punctuation
Oct
11
suggested approved edit on Very slow response even with a high number of available connections
Oct
6
comment How to add a default null row if no results from the dynamic pivot query
@user48768: By your original query I meant the one you want (and have been trying) to append an empty row to. That is, the entire PIVOT query would be the your query in the above suggestion.
Oct
6
answered How to add a default null row if no results from the dynamic pivot query
Oct
4
comment When you type an SQL query in interpreter, what does happen?
No, I didn't have issues with the missing comma (but thanks for it nonetheless). As I see it, the problem is the placing of the closing bracket: in my opinion, the bracketed expression should read (in SQL Server and other database engines).
Oct
3
comment When you type an SQL query in interpreter, what does happen?
However the four key stages (…) and other database engines are… – hm, this doesn't seem to make much sense. Perhaps the and other database engines should be in the brackets too.