Re: How many records from a SELECT statement?
Date: Thu, 21 Jul 1994 12:20:32 GMT
Message-ID: <CtAIA8.FBq_at_ncrcae.ColumbiaSC.NCR.COM>
In article <1994Jul21.074519.16041_at_pttdis.pttnwb.nl> erwin_at_pcssdc.pttnwb.nl (Erwin Dondorp) writes:
>Hi,
>
>In several applications I need to draw a percentage bar to monitor
>the status of large SELECT statements.
>One of the applications works with a SELECT statement that is more
>or less a black box, so I cannot predict acuratelly how many
>records will be SELECTed.
>
>Does anyone know a way to acuratelly predict the number of records
>that will be selected when given a SELECT statement?
>(i.e. instead of all the data I just want COUNT(*) using the same
> table(s), conditions, etc)
>
>One way to do it is to create a VIEW:
>
>CREATE VIEW tmp_view AS <select statement>;
>SELECT COUNT(*) FROM tmp_view;
>DROP VIEW tmp_view;
>
>Any one know a better solution?
> (preferably without creating objects in the database)
Unless I misunderstand your question, you can just do the following without the creation of a view:
SELECT COUNT(*) FROM table where blah blah blah;
-- Elizabeth Fitzpatrick (803) 939-6520 Process & Information Engineering elizabeth.fitzpatrick_at_ColumbiaSC.NCR.COM AT&T Global Information Solutions - PSSD ColumbiaReceived on Thu Jul 21 1994 - 14:20:32 CEST