|
Let's asume I have a parent-child structure setup in SQL (server 2005):
CREATE TABLE parent (Id INT IDENTITY PRIMARY KEY, Name VARCHAR(255)) CREATE TABLE child (Id INT IDENTITY PRIMARY KEY, parentId INT, Name VARCHAR(255)) insert into parent select 'parent...
Started by edosoft on
, 6 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Into @parent select 'parent with 2 children' insert into @child(name, parentid) select 'single child of 2 of parent 2 child 2 of 2 of parent 2 single child of parent 1 1 parent with 1 child NULL....
|
|
There are two SQL tables:
Parents: +--+ + |id| text | +--+ + | 1| Blah | | 2| Blah2 | | 3| Blah3 | +--+ + Childs +--+ + + |id|parent|feature| +--+ + + | 1| 1 | 123 | | 2| 1 | 35 | | 3| 2 | 15 | +--+ + +
I want to select with single query every row from...
Started by PiotrK on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
C on p.id = c.parent
This should work:
SELECT p.id, p.text, c.id, c.parent,c.feature FROM parent p, c.parent) SELECT p.id, p.text, mf.id, mf.parent, mf.feature FROM PARENT p LEFT JOIN max_feature mf ON mf.parent = p.id
Non CTE equivalent....
|
|
I have a PARENT thread responsible for performing jobs, for each job it launches a CHILD thread to do the work - however it should never be allowed to launch more then one at a time (single child). For example in the case where there are 10 jobs to do...
Started by Shaitan00 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
This way, you only do one job at....
Another way of handling this is to keep the worker thread alive the whole time and have it read from a queue of pending jobs .
You could use Thread.IsAlive , if you're happy to effectively poll as shown in the question .
|
Ask your Facebook Friends
|
I have a list of addresses contained in a parent object called Branch. Branch may or may not have these addresses defined and I need to get a flat hierarchy or these branch and address.
var x = from p in CurrentBranchList where p.ScheduledForDeletion ...
Started by AboutDev on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
IQueryable<Branch> ....
Not the most discoverable feature of Linq I'm afraid.
Take a look at this post which shows how to use the DefaultIfEmtpy construct to carry out a LEFT JOIN .
Here's how.
You need a left outer join rather than an inner join .
|
|
I have an array similar to this:
Array ( Array ( [ID] => 1 [parentcat_ID] => 0 ), Array ( [ID] => 2 [parentcat_ID] => 0 ), Array ( [ID] => 6 [parentcat_ID] => 1 ), Array ( [ID] => 7 [parentcat_ID] => 1 ), Array ( [ID] => 8 [...
Started by Joel on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Item[ 'children' ] = array(); // if parent doesn't exist yet, initiate it along with an empty' => array() ); } // if this item is initiated already (as being a parent) merge it with the current to intitiate children array for items....
|
|
Hi,
I am working on a PRISM / CAL solution, but the problem may be WPF specific:
If I create one instance of an control (e.g. TextBlock) and add it as child to a StackPanel, there is no way to add it as "child" to another StackPanel (parent already set...
Started by Christian on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
There is no way to parent the same UIElement in multiple places.
A DataTemplate with the Customer type.
|
|
I understand how STI works, in that I have say a Post model that contains posts on a forum and several sub-posts like 'ordinaryUserPost' and 'adminUserPost' etc.
Now, I want to define the same method in each of the sub-posts, but the method would do something...
Started by Stephen ODonnell on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
And in the parent (Post)..
|
|
Is there any way to get NHibernate to let me store multiple ChildObjects in the ChildObjectTable but refer them back to different ParentObjects? Or do I have to create a separate ChildObject class/table for each ParentObject type?
I've boiled this down...
Started by Chris Stavropoulos on
, 4 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For example, you can have a class called; } void AddChild(Child child); Int64 Id... .
Perhaps you could create an abstract base class for your parent classes? That way, a given child object could refer back to the abstract type for its parent.
|
|
Co-Parenting
Looking for a Co-Parent?
If you are looking for a co-parent you can Join PollenTree today to find and contact a suitable co-parent match completely free.
What is Co-Parenting?
If you are here you may well already know about it, but in case...
Started by by SLK230 on
, 20 posts
by 5 people.
Answer Snippets (Read the full thread at occonnect):
Quite a few don't view marriage as prerequisite to parenting as single as single....
Actually be interested into looking into this, although I'd much prefer just to adopt as a single parent to start thinking about children...
|
|
Are There As Many Single Parent families As I Think There Are?
This is what I'd like to know. Apparently there are 12 million married couples for now but I seem to be more familiar with single parent families. Me personally only ever lived with one parent...
Started by Dr Good Manners on
, 20 posts
by 17 people.
Answer Snippets (Read the full thread at thestudentroom):
Edit: Negged for this? Re: Are There As Many Single Parent families As I Think There Are?
When ....
Re: Are There As Many Single Parent families As I Think There Are?
My parents are married actually thought about this.
|