Question: call a function continuously in c# console application. without using infinite loop and recursion because if use those then cpu usage is more.please can any one help me to solve this problem.some one suggest me to use background thread, but it doesn't call the function continuously.

```
Thread th = new Thread(//fun);
th.IsBackground = true;
th.start();

```

Answer: 
You can not use join on update and delete queries. You have to use subqueries.

> 
> Joins are not supported on update and delete queries because it is not
>  supported on all dbms. It won't be implemented in Doctrine 1 or
>  Doctrine 2. You can however get the same affect by using subqueries.
> 
> 
> 

<http://www.doctrine-project.org/jira/browse/DC-646>

If you are using MySQL, using subqueries will not work. You will have then to use 2 queries.

> 
> In MySQL, you cannot modify a table and select from the same table in
>  a subquery
> 
> 
> 

<http://dev.mysql.com/doc/refman/5.0/en/subqueries.html>
try using a subquery instead [Join will not work in DQL while you re doing an update](https://stackoverflow.com/a/5598894/1427338):

> 
> LEFT JOIN, or JOINs in particular are only supported in UPDATE
>  statements of MySQL. DQL abstracts a subset of common ansi sql, so
>  this is not possible. Try with a subselect:
> 
> 
> 

```
$qb = $this->getEntityManager()->createQueryBuilder();
    $qb ->update('MyBundle:Entity1', 'e') 
        ->set('e.visibile', '1')
        ->where('e.id IN (SELECT e1.id FROM Entity1 e1 INNER JOIN e2.Entity2 e2 WHERE e2 = :id')
        ->setParameter("id", 123);

```