Subject | Re: [firebird-support] Re: SQL for master-detail |
---|---|
Author | Aage Johansen |
Post date | 2007-12-27T23:24:21Z |
Helen Borrie wrote:
the search criteria, i.e., 2 bytes for each record found. Select *
returns ALL fields for each record found. For an EXISTS query it
probably doesn't make a lot of difference to what is floating about
in memory but it's not going to be true where intermediate output is
actually stored in a buffer somewhere, or final output is returned to
the caller.
I took Ed's "this SQL" to mean exactly the NOT EXISTS part of Sean's post:
...
where
NOT EXISTS(
select 1
from DetailInfo d
where m.Master_ID = d.Master_ID
)
So, while you may be "completely correct", I think I was
"sufficiently correct". :-))
--
Aage J.
> At 08:41 AM 28/12/2007, you wrote:number 1, 2 bytes for smallint) -- for each record found that matches
>> Ed Dressel wrote:
>>>> select 1 from DetailInfo d where ...
>>> what does the '1' do in this SQL?
>>>
>> You have to have something in the field list, but you are not
>> interested in anything in particular. So, "1" is convenient - but
>> you could just as well use "*" (select * from ...).
>
> Actually, that's not quite correct.
>
> SELECT 1 actually outputs a single value -- a derived field (the
the search criteria, i.e., 2 bytes for each record found. Select *
returns ALL fields for each record found. For an EXISTS query it
probably doesn't make a lot of difference to what is floating about
in memory but it's not going to be true where intermediate output is
actually stored in a buffer somewhere, or final output is returned to
the caller.
>Helen,
> ./heLen
>
>
I took Ed's "this SQL" to mean exactly the NOT EXISTS part of Sean's post:
...
where
NOT EXISTS(
select 1
from DetailInfo d
where m.Master_ID = d.Master_ID
)
So, while you may be "completely correct", I think I was
"sufficiently correct". :-))
--
Aage J.