Could you explain iun details what you need to select ...
because as far as I can see in your statement you will
have one and the same row doubled
t1.id = t2.id
says when row 5 from table A is row 5 from A
at the same time
"value" colunm from that row to has different values
 ...that is nosense

of course this is valid only if .id is a primary key
is that your select exactly ?

regards,
bogdan

----- Original Message -----
From: "Michael Burschik" <[EMAIL PROTECTED]>
To: "'Apache Torque Users List'" <[EMAIL PROTECTED]>
Sent: Thursday, April 08, 2004 7:02 PM
Subject: RE: Can I do this with Criteria?


> Now, you might think I don't really need the alias feature, but that is
> because I made a slight mistake in my example. What I actually need to do
is
> this:
>
>   select t1.something from TABLE as t1, TABLE as t2
>     where t1.id=t2.id
>     and t1.value=somevalue
>     and t2.value=someothervalue
>
> You see, I use the same table more than once in order to avoid
sub-selects.
>
> Since I wasn't able to figure out a way to do this with Criteria, I tried
to
> do without by piecing together an SQL statement and using the Torque
> connection to submit it to the database. Strangely enough, the select took
> very long to complete (something like three minutes) and the result was
not
> correct, although the same statement typed at the command prompt (mysql)
was
> blindingly fast and delivered the correct results. Can anyone suggest a
> reason for this behaviour?
>
> Regards
>
> Michael Burschik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to