Re: Outer Join Question
Re: Outer Join Question
- Subject: Re: Outer Join Question
- From: Ricardo Strausz <email@hidden>
- Date: Fri, 9 May 2003 19:22:43 -0500
After much searching in WebObjects doc and OpenBase doc. I have found
the way to do that using raw SQL, but I'd prefer to keep database
independance if possible. So I came up to the Outer Left Join thing.
However, I am not very familiar with SQL. It looks like SQL is
generated OK by WO, but for some reason I don't understand it does not
do what I was expecting.
If you use "standard" sql (i.e., not db-specific commands) you may keep
your db-independence... as far you are using a db which supports sql.
So, use only commands as:
SELECT * FROM tbs WHERE conds AND/OR moreconds ORDER BY keys
Such a sql-statement most be supported by all (decent) dbs.
On the other hand, the SQL you showed is not for doing what you want to
do, so it is not OK!
Your sql-statement most like the previous I typed... but let me be more
specific, it most look like (note the OR):
SELECT * FROM Restaurant WHERE restaurantOpen AND (seatsAvailable OR
(SELECT count(*) FROM Avalilability WHERE
Services.availability=Availability.key)=0)
I insist, such an expression must be supported!
(see http://www.1keydata.com/sql/sql.html )
Dino
http://homepage.mac.com/strausz
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.