Re: Simple Query Issues (Improved Grammer)
Re: Simple Query Issues (Improved Grammer)
- Subject: Re: Simple Query Issues (Improved Grammer)
- From: Brian Allen <email@hidden>
- Date: Tue, 01 Apr 2003 09:00:16 -0600
Here is a hopefully better explanation.
Table B has all of the records assigned to you. Table A has all of the
records that could be assigned to you which would includes the records
already assigned.
I want only the records not assigned to you that is the difference between A
and B. Or another way, B's records subtracted from A's records.
- Brian Allen
on 4/1/03 8:39 AM, Chris Giordano at email@hidden wrote:
> Brian,
>
> This is still going to give you everything in A unless you've only got
> one item in B, and in that case you get everything but one item in A.
> It still doesn't answer what I think you want to ask, which is "how
> many items in A don't have a match in B?" Is that the question that
> you're trying to answer with this query?
>
> Assuming that it is, I just did some testing (which is why it took me
> overnight to get back to you -- I had to download and install the
> updates for the December developer tools and Java) and using the
> Authors example code as a base (from chapter 12 in the Web Applications
> book that came with WO). This has a to-many relationship from the
> Authors table to the Books table. I can identify all authors with no
> books by noting that the books() array will be empty when there are no
> associated items.
>
> So, although this doesn't give you the fetch specification to get what
> you're looking for, it does give you a means to get the same results.
> Jonathan Rochkind had some suggestions for how to achieve the same in a
> query. If you're not working with a lot of records, or they're all
> loaded anyway, just looping through them, checking which ones have 0
> items from B and sticking those into a secondary array would give you
> something to work from.
>
> If this isn't the question that you're trying to answer, what is (since
> all of my discussion is based on my interpretation of your question)?
>
> chris
>
>
>
> On Monday, March 31, 2003, at 04:04 PM, Brian Allen wrote:
>
>> Sorry, I should have indicated distinct rows as
>> follows:
>>
>> SELECT DISTINCT A.item1, A.item2, A.item3 FROM A,B
>> WHERE A.item1 <> B.item1
>>
>> - Brian Allen
_______________________________________________
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.