hi all:

I've got a mySQL database I'm using SQLobject to query. I'm doing ok with simple queries - I'm a simple guy - but now I want to try something more complex.  In particular I want to use UNION.  Is this possible with SQLobject?   If not I could use a subquery, I guess.    I've searched the archives and found only one message on the topic of UNION (from Oleg), but the example there used cursor(), which I haven't used up to now.

here's my SQL query, which produces the desired results in command-line mySQL:
mysql> select origin, dest, hoodfrom, hoodto, name, quadrant
    -> from route, neighbourhood
    -> where route.hoodfrom = neighbourhood.name
    -> and neighbourhood.quadrant = 'NE'
    -> union
    -> select origin, dest, hoodfrom, hoodto, name, quadrant
    -> from route, neighbourhood
    -> where route.hoodto = neighbourhood.name
    -> and neighbourhood.quadrant = 'NW';

And here's the same query using subquery:
select origin, dest, hoodfrom, hoodto, name, quadrant from route, neighbourhood
where (route.hoodfrom = neighbourhood.name and neighbourhood.quadrant = 'NE')
and exists (select origin, dest, hoodfrom, hoodto, name, quadrant from route, neighbourhood
where route.hoodto = neighbourhood.name and neighbourhood.quadrant = 'NW')


all hints appreciated!

thanks,
--
Stewart Midwinter
stewart@midwinter.ca
stewart.midwinter@gmail.com
Skype, GoogleTalk, iChatAV, MSN, Yahoo: midtoad
AIM:midtoad1