db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Emminger <e...@ericemminger.com>
Subject Re: modified column
Date Thu, 13 Mar 2003 15:08:39 GMT
Hi Dan

The age example seems simple.

criteria.add(UserPeer.BORN, 2003 - 20);

Or, if you wanted them at least 20 years old, it would be

criteria.add(UserPeer.BORN, 2003 - 20, Criteria.GREATER_EQUAL);

I'm trying to understand the general concept, but I don't think I get 
it! :) Are you talking about a database-specific function? Could you 
explain it again?

Eric

Dan Allen wrote:
> Is it at all possible to do something like:
> 
> add("(" + 2003 " - " + UserPeer.BORN + ")", 20);
> 
> to get people that are 20 years old?  Assume that the actually query
> is more complicated and it is not as simple as just comparing the
> year they were born, to 2003 - 20.  I am going for a concept here,
> not a solution to this example.
> 
> Why can't a column be modified in the WHERE clause?  This makes it
> inconvenient when doing conditions.  I would rather not have to
> create a CUSTOM add() for this.
> 
> Dan
> 


Mime
View raw message