1,827 reputation
721
bio website
location Ukraine
age
visits member for 3 years, 1 month
seen 2 hours ago

18h
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?
1d
comment Please help on “PostgreSQL installation checklist”
Doing all this for you would be a proper job, not a mere help. So, you probably need to hire someone for money and this site is not where you should make such requests. On the other hand, if you do need just help, please be specific and tell us what exactly you cannot do about your problem. Tell us where you are stuck and what you have already tried (so that we don't try suggesting what didn't work for you).
Mar
25
comment data calling from one page to another?
As asked, this seems too broad. What specific problem are you facing that you want to address foremost and are asking for help with? Do you want to know how to start using MySQL in PHP? Or how to send queries? Or how to read the results? Note that some of the questions may be off-topic for this site and you might want to try Stack Overflow (or other places) instead. But first please try to search for available online information, as I'm sure you can find plenty examples to get you started with whatever you are unfamiliar with at the moment and to help you to arrive at a proper, specific question to ask.
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 I want query postgresql group by month and type
Sorry but your question is not clear. There is no way anyone could tell from the posted information what exactly you are having trouble with. Please put more effort into asking a coherent question.
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
2
comment How can I use 'system pwd' command with MySql CONCAT() function?
And why would you need to know the current working directory of the server anyway?
Feb
27
comment I would like to get all values greater than 80, rank, then group in order to get a count of threshold breaches
The support, even though limited, for OVER that they introduced to T-SQL in SS 2005 opened quite a realm of new possibilities. Adding support for analytic functions like LAG and extending the support for OVER in SS 2012 at first seemed to me somewhat bleak in comparison. It's solutions like this that can make the improvement look more impressive. I am impressed, thanks for sharing this.
Feb
24
comment How to speed up query which is using <@> operator?
I'm not familiar with this <@> operator but the expression basically boils down to table.somepoint - someconstantpoint <= someconstantdistance, correct? I guess in order to make it sargable, you'd need to invert it to an equivalent of table.somepoint <= someconstantpoint + someconstantdistance. Not sure but maybe the earth_box() function and <@ operator are what you need here, as in "User".position <@ earth_box(Point(45, 45), 621.371192).
Feb
24
comment Query to return zero if nothing exist
OP wants the totals to be returned "vertically", i.e. in a single column. How do you think your query would return them? No, not horizontally, but diagonally.
Feb
20
comment Issues with Optimizing TSQL Script
Logically, the join condition in your last query is not equivalent to what you are checking in the multi-statement script. The former covers a case not covered by the latter: MD.ManagerID = CR.CustomIdentifier AND CR.CounterPartyID = '' AND MD.SecurityAccount = CR.AccountCode. But if that combination of values can never appear in your data, then your attempt seems fine, only you need to replace null as SecurityCode with cr.GenevaCode as SecurityCode, of course, as well as include cr.GenevaCode into the GROUP BY, I guess.
Feb
20
comment I would like to get all values greater than 80, rank, then group in order to get a count of threshold breaches
A SEDE link (SQL Fiddle's been sluggish lately).