This:

![enter image description here](https://i.stack.imgur.com/kkyke.png)

outputs following:

![enter image description here](https://i.stack.imgur.com/lwFIQ.png)

Now I want to apply count function on above table, for that I executed following query.

```
select count(date1) from (
select date1 from tmp where 
current_date > date1
);

```

And got this error:

> 
> Error code 20000, SQL state 42X01: Syntax error: Encountered ""
> at line 4, column 1.
> 
> 
> 

**Note: I am using Java DB**