On Thursday, April 28, 2011 7:55:32 AM UTC+2, mb wrote:
> I think this is a feature, not a bug.

I wouldn't call something as stupid as forcing repeating expressions a 
feature. It's the way SQL works, so we can't blame H2; it's a standardized 
misfeature.

On Thursday, April 28, 2011 8:39:25 AM UTC+2, Andreas Henningsson wrote:
> Basicly the select part of the query is done after the where filter is 
applied.
> So you can't use an alias created in the select part in the where part
> of the query.

Sacrificing logic for a sentence-like look is a bad idea. Nonetheless, it 
could work, you'd just need to look at the SELECT part twice (first for 
finding the aliases). Or invent an alternative syntax for defining aliases 
elsewhere. It'd be nice, but it's a lot of work.

> You have to do it like in your Workaround example.

A subquery would do as well, but it may or may not cost performance.


-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-database@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to