Subject | Re: [ib-support] How can I check if a table is empty? |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-05-06T07:31:25Z |
No, when used within an EXISTS it doesn't return anything, just check for
the existence of at least one row. In other circumstances SELECT * can
waste bandwidth, but Dimitrys suggestion in this case is very good.
Set
At 14:49 06.05.2003 +0800, you wrote:
the existence of at least one row. In other circumstances SELECT * can
waste bandwidth, but Dimitrys suggestion in this case is very good.
Set
At 14:49 06.05.2003 +0800, you wrote:
>Isn't SELECT * returns everything, and when applied to large table,
>introduce much overheads ?
>
>Pls correct me if I'm wrong. I always think this is the case.
>
>Albert.
>
>Dimitry Sibiryakov wrote:
> > On 5 May 2003 at 15:00, mcrosman1957 wrote:
> >
> >
> >>I am developing a store procedure and a trigger in which I need to
> >>check if a table is empty or not.
> >
> >
> > IF (EXISTS (Select * from MyTable)) THEN ...
> >
> > SY, Dimitry Sibiryakov.