db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bogdan Vatkov" <bvat...@globaltech-bg.com>
Subject Re: Can I do this with Criteria?
Date Thu, 08 Apr 2004 16:16:09 GMT
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" <Burschik@lotto-berlin.de>
To: "'Apache Torque Users List'" <torque-user@db.apache.org>
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: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message