Subject Re: How can I cjeck if a table is empty?
Author mcrosman1957
Thank you HeLen

Regards,

Marcelo.

--- In ib-support@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 05:22 PM 4/05/2003 +0000, you wrote:
> >Hi,
> >
> >I am using InterBase 6.0.2.
> >
> >How can I check if a table is empty?
> >
> >I have a table named MyTable with a field named XXX.
> >
> >I have been using the instruction below to check if MyTable is
empty
> >or not:
> >
> >
> >"Select Count(XXX) as NumRecords from MyTable"
> >
> >
> >If NumRecords = 0 then MyTable is empty.
> >
> >
> >Is there another way to do check if a table is empty?
>
> If you have a generated primary key then
> select min(ThePrimaryKey) as blah from Mytable would be the fastest.
>
> heLen