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

Apr
22
revised need to find instances which have multiple rows with the same userID and ResourceID and have a location of 1 and also have other locations
formatting
Apr
22
suggested approved edit on need to find instances which have multiple rows with the same userID and ResourceID and have a location of 1 and also have other locations
Apr
21
comment The cost of left out join versus a select
My understanding is the OP can't control the join type because that is something that Ebean (a framework of some kind? I don't know) generates based on an instruction like return aInstance.bInstances. Nevertheless, I don't think there's a much clearer answer to give at this point. They never elaborated on what exactly the generated left join query looks like.
Apr
20
comment how to revoke backup and restore permission from database owner
Why would you modify privileges of the built-in database owner role rather than creating a custom role without the backup or restore permission and moving your users to it?
Apr
14
revised Left outer join not returning all rows in a grouping query
fixed terminology (the problem is clearly about rows, not columns); added some formatting
Apr
14
suggested approved edit on Left outer join not returning all rows in a grouping query
Mar
31
comment How is the B-Tree created for a composite PK?
When I query this, only PersonID was sorted physically and PersonAge was left out (not sorted) – what specifically do you do when you are trying to determine that?
Mar
25
revised mysql need help optimizing query
minor grammar and formatting improvement
Mar
25
suggested approved edit on mysql need help optimizing query
Mar
24
comment How to query readonly replica in Always On cluster
I wasn't sure I'd manage a coherent answer. Thanks for coming back and sharing what you actually did.
Mar
24
comment How to query readonly replica in Always On cluster
@retif: Could you afford a duplicate linked server item CLUSTERname2 configured the same way as CLUSTERname but additionally having ApplicationIntent=ReadOnly in its connection string (and use CLUSTERname2 in SELECT-only queries, of course)?
Mar
24
comment SQL query for next occurrence of specific date
You could also complicate it even further to get rid of the subselect (no idea if that would be of any benefit).
Mar
18
comment use parameters in a Cte
As for the Connect item, I think it's about a different issue. It's about using functions when calling a stored procedure, and the OP wants to use functions in a specific place of a declaration.
Mar
18
comment use parameters in a Cte
And BoL is again not precise: The default value must be a constant or it can be NULL. Nothing about letting you reference any of the already parsed parameters.
Mar
18
comment Joining two inline functions, slows considerably when filtering on second function
Your use of terminology is a little confusing. Contrasting table-valued functions with inline functions like that seems to imply that inline functions are not table-valued. They are table-valued too, and even if you didn't know that, the OP's syntax certainly suggests that they return a table. The correct terms to contrast the two kinds would be multi-statement TVF (yours) vs inline TVF (OP's).
Mar
17
comment Joining two inline functions, slows considerably when filtering on second function
Perhaps it would be easier to find the issue if there were actual execution plans to compare.
Mar
11
comment Getting all descendants of a parent
According to the docs, Teiid does support recursive queries, you just need to omit the keyword RECURSIVE. (And while we are at it, you probably also need to get more acquainted with the manual.) Anyway, tagging your question with the wrong database system and not tagging it with the actual one is why you get the wrong answer.
Mar
6
comment SQL Server: Recursive dynamic SQL puzzle
First of all, please stop using single quotes around column aliases (as in 'b' = ...) – that is just bad. Secondly, what does the 'b' = ... example have to do with your question anyway? Or are you also confusing cases like SELECT columnalias = ... and SELECT @variablename = ...? You should probably ask about those separately.
Mar
4
comment Query for orders that contain a product without using sub-query
Orders_without_a_product_View seems a misnomer if its purpose is to find orders with a specific product. Or maybe I'm missing something.
Mar
4
answered Query for orders that contain a product without using sub-query