Answer the question
In order to leave comments, you need to log in
TimerTask and Thread?
When working with the Timer and TimerTask classes , what is the TimerTask supposed to do in a separate thread? Or is it worth making a separate thread and running it in a TimerTask?
Answer the question
In order to leave comments, you need to log in
TimerTask inherits the Runnable interface, so it's enough to place the code to execute in the run() method of your own TimerTask descendant class.
1) What do you think? Given that the UI does not freeze.
2) There is source code and documentation.
SELECT t1.*, count(t2.*) as count FROM t1
INNER JOIN t2 ON t1.id = t2.parent
WHERE t1.parent IS NULL
GROUP BY t2.parent
HAVING count > 3
select
table.id, min(table.name)
from table
left join table as t2 on t2.paren=table.id
where table.parent is null
group by table.id
having count(t2.parent)>=3
For a hierarchy with a depth of 6 elements (maximum), the following query will do:
SELECT
t1.*
, count(t2.id) AS count
FROM
table AS t1
INNER JOIN
table AS t2 on t1.id = t2.parent
INNER JOIN
table AS t3 on t2.id = t3.parent
INNER JOIN
table AS t4 on t3.id = t4.parent
INNER JOIN
table AS t5 on t4.id = t5.parent
INNER JOIN
table AS t6 on t5.id = t6.parent
WHERE
t1.parent IS NULL
GROUP BY
t1.id
HAVING
count(t2.id) >= 3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question