Re: Outer Join Question (more)
Re: Outer Join Question (more)
- Subject: Re: Outer Join Question (more)
- From: Ricardo Strausz <email@hidden>
- Date: Fri, 9 May 2003 20:12:22 -0500
I forgot to type the following link which have a nice application (and
discusion) on Left Joins:
http://www.experts-exchange.com/Databases/Q_20317087.html
In it you will se an example of a sql-statement using "truely" such a
feature
(which is not db-independent, indeed)
Suerte!
On viernes, mayo 9, 2003, at 19:22 America/Mexico_City, Ricardo Strausz
wrote:
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.
_______________________________________________
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.