It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am trying to find the parent with the most children. I feel like this should not be so hard however I find myself struggling.
I am using postgresql and Ltree.
Thank you
It's the same logic as for any other case, find a function that will give you the parent and group by it. This should work:
SELECT subpath(path,0,1), count(*)
FROM test
GROUP BY subpath(path,0,1)
ORDER BY count(*) DESC limit 1;
http://sqlfiddle.com/#!12/8fb17/5
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
If my table in database which has 100 data. I want to find between tenth with twentieth. I want to know how to find them with MagicalRecord, or sqlite statements.
Forget Magical Record and use native Core Data.
fetchRequest.fetchOffset = 10;
fetchRequest.fetchLimit = 10;
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How can I get a dummy database where I can do some indexing on tables?
What dummy database is the best for my study?
have u tried http://sqlfiddle.com/? It is simple to use and supports mySQL and SQL Server
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
How to create Custom View like this
take a look at GCRetractableSectionController. Maybe it can handle the behavior you need, just check out the example project provided with it.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I’m trying to work out an average grade from a database file using the ‘Do Loop’ method; I’m completely clueless how to even start it. Does anyone have any tips or is able to help me?
Regards, Jack.
Rather than looping in vb, calculate the average in SQL.
E.g.,
select StudentID, avg(Grade) as AverageGrade
from StudentGrade
group by StudentID
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
What is user define function in sql server 2005.How Can I see them from design point of view.
I wanted to create and execute the function.Can anybody explain me.I have not done it before.
User-Defined Functions from MSDN Books Online