|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Total Number of Records from Several Views
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 Something like:
SELECT (SELECT COUNT(*) FROM v1) + (SELECT COUNT(*) FROM v2) + (SELECT COUNT(*) FROM v3) AS totcount -- Show quoteHide quoteTibor 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 > 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 > >
Other interesting topics
|
|||||||||||||||||||||||