Home All Groups Group Topic Archive Search About

Total Number of Records from Several Views



Author
17 Nov 2006 2:58 PM
SQL_Rookie
Hey everyone,
Let me say thanks in advance for any assistance I receive. I need to
get a total number of records from 4 different views. I'm trying to
incorporate this into a function that is being written. Please forgive
me I am very new to this and not sure what I need to include in this.

Thanks,
Gabe Boyer

Author
17 Nov 2006 4:24 PM
Tibor Karaszi
Something like:

SELECT
(SELECT COUNT(*) FROM v1)
+
(SELECT COUNT(*) FROM v2)
+
(SELECT COUNT(*) FROM v3)
AS totcount


Show quoteHide quote
"SQL_Rookie" <gbo***@scgov.net> wrote in message
news:1163775494.429948.258320@b28g2000cwb.googlegroups.com...
> Hey everyone,
> Let me say thanks in advance for any assistance I receive. I need to
> get a total number of records from 4 different views. I'm trying to
> incorporate this into a function that is being written. Please forgive
> me I am very new to this and not sure what I need to include in this.
>
> Thanks,
> Gabe Boyer
>
Are all your drivers up to date? click for free checkup

Author
17 Nov 2006 8:54 PM
SQL_Rookie
Thanks Tibor,
This worked great!


Tibor Karaszi wrote:
Show quoteHide quote
> Something like:
>
> SELECT
> (SELECT COUNT(*) FROM v1)
> +
> (SELECT COUNT(*) FROM v2)
> +
> (SELECT COUNT(*) FROM v3)
> AS totcount
>
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "SQL_Rookie" <gbo***@scgov.net> wrote in message
> news:1163775494.429948.258320@b28g2000cwb.googlegroups.com...
> > Hey everyone,
> > Let me say thanks in advance for any assistance I receive. I need to
> > get a total number of records from 4 different views. I'm trying to
> > incorporate this into a function that is being written. Please forgive
> > me I am very new to this and not sure what I need to include in this.
> >
> > Thanks,
> > Gabe Boyer
> >

Bookmark and Share