I have a simple, one level parent child relation table, with following columns:
ID_Asset| Parent_ID_Asset | ProductTitle
I need output grouped by Parent followed by children, and also sorted by Parent and Children Name. My attempts in the fiddle. The parent must be first.
See here for details...
Hi McNets, thank you for your time. I have already tested using COALESCE, the problem is the ProductTitle column needs to be sorted alphabetically as well, the ADONIS group needs to be on top. — Petr Šimůnek4 mins ago
@McNets The link in your answer is the same as in the question. Rextester doesn't generate a new link automatically, so you may have tested your solution but ended up copying the same link and thus your answer is referencing the OP's fiddle. That could be what confused the OP, although I'm not entirely sure.
@ypercubeᵀᴹ It doesn't show the right sorting order for the fragment the OP specified in their question.
I think McNets's solution should work. Only there's no need to do COALESCE(Parent_ID_Asset, '') in the ORDER BY, simply Parent_ID_Asset can do just as well. Also the CASE can be replaced with the equivalent COALESCE expression for conciseness
SELECT
ID_Asset,
Parent_ID_Asset,
ProductTitle
FROM
Test
ORDER BY
COALESCE(Parent_ID_Asset, ID_Asset),
Parent_ID_Asset,
ProductTitle;
I'm not posting it because it's the same solution, just two expressions slightly modified without changing the result.
They shouldn't have limited their example output to just "the relevant part". The actual relevant part is apparently the entire output.
MAX(CASE WHEN Parent_ID_Asset IS NULL THEN ProductTitle END) OVER (PARTITION BY COALESCE(Parent_ID_Asset, ID_Asset)) as the first sorting term, keeping all the others too.
@hot2use let's just say I'm glad I know how to turn wi-fi off on my phone. But, overall, it works really well, and is super easy to setup. We've noticed some issues with certain sites not working as expected, presumably due to some scripts being DNS blackholed by Pi-Hole - it can be a little difficult to determine which urls need to be whitelisted to fix those issues. Overall, it feels like being behind a somewhat restrictive proxy.
From the Radare.Org Facebook page
Clippy is now available in r2!
But the link to radare.tv is broke. I was talking to someone else at the Walmart checkout aisle and they were telling me about this too. How can I use Clippy in Radare?
do you see something different between both executions?
Clearly there is!
perhaps there was something else I was demonstrating... hrm...?
you can edit that, I unfortuantely can't yet, because I'm banned.
But to answer the question, Radare's Clippy has emotions, and you can't control them. So if you get the wrong emotion, you just gottra reroll and do it again
And, yes, I use this. My MOTD is set with Radare.
Also, is "In addition, you should provide a link to back up your answer." even fair. I provided actual code, what is my link supposed to be to?
I don't know how the SU mods make it. SU and AU has the biggest jerks on the network moderating those sites.
I need an to create a site www.letmediffthatforyou.com =) like lmgtfy
On occasion of our anniversary celebrations, we offered some cheese boards a while back. If you were late for that, though, no sweat! You’re just in time for another limited edition super special swag contest!
This is the bit where you go “It’s about time, isn’t it?” To which I’ll reply with “we...
Something has messed up the cluster service on one of the boxes and someone has just tried to shut down the AG and blow away the clustering in general. This is making the AG throw a major fit since it doesn't know where it stands due to the server never returning.
@billinkc can you elaborate any on the "nightmare" that was caused by that server that was renamed?
I'm going to do the fix tonight and both I and my Euro colleague believe there should be little to no other systems effected. hoping that is actually true :)
@JzInqXc9Dg Nothing specific. It was a decade and 7(?) employers ago. All I remember was there was how things worked on every other box in the organization and then there was that box. Which was, of course, production
In the first 24 hours after posting Identity column re-seed: when it is necessary? , garnered about 700 Visits. Was it real? Was it some form of hacking?
(I'm not complaining; my Answer got a lot of upvotes at the same time.)
@JzInqXc9Dg I can't remember all the details about your situation, but I had a client that renamed their Windows Server that was hosting a SQL Server instance, and they had lots of problems with it until they followed the steps in this MS Docs article.
anyone have an opinion on this - decent number of views, and probably an answer could be added to show how to use DBCC PAGE with the page number, but what help is that likely to be for a future visitor? I mean, other than sending them down the path of looking at something they ostensibly have no idea about.
@JzInqXc9Dg Okay, awesome. The only issues they had during that process were with remote logins / replication - and the solutions were covered in that same article.
To be more specific about "lots of problems," they had linked servers and were using "four part names" to refer to objects in different instances / databases. And resolution was failing because of the mismatch.
im just not physically there to remedy anything and ill be doing it at about 4am their time - but they have been tipped off and will be ready to firefight if need be! :)
@MaxVernon Heh, that's what they did for the first server rename a year or so prior! When they needed to do another rename (god knows why), they didn't want to support multiple CNAME entries all going to the new (third) name.
Not only is this link-only, it's also irrelevant, because the question is about SQL Server, not MySQL. Are you here to just promote your site? — Andriy M1 min ago
The user is sort of active on SO but their latest SO answer is very similar
" any connections that used the old computer name must connect by using the new name." -> well, as far as I can tell the original renaming of the server must have been done before anything else was connected. everything seems to already be using the "new name"
that seems really weird compared to all the documentation I've read - but maybe also indicates this should be a smooth operation???
maybe all the docs are assuming you are renaming a server in which connections have already been made to what will become the old name
It's curious how it took only four votes to delete the SO answer I linked above. Even curiouser is that only one of them (mine) was a Delete vote, the other three were Recommend Deletion.
Something to do with the answer score at the time of voting, perhaps
Are You There God? It's Me, Margaret is a 1970 book by Judy Blume, typically categorized as a young adult novel, about a sixth-grade girl who has grown up without a religious affiliation, due to her parents' interfaith marriage. The novel explores her quest for a single religion. Margaret also confronts typical issues faced by early adolescent girls going through puberty, such as buying her first bra, having her first period, and feeling attracted to certain boys. The novel has been frequently challenged since the 1980s due to its frank discussions of sexual and religious topics.
== Background... ==