Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Work Around

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2010-06-08 : 07:54:04
Hi,

I have a table called tblImports which is built up of two fields;

pat_eid and goldpat_eid...

At anyone time either pat_eid or golpat_eid will be populated to the table. There will be no scenario where both columns will be filled with data..

Now what I want to do is derive the Count of the total records at one time.

For example, if I have 15 values for the pat_eid = Count = 15

Therefore, when one has no records the other will have and I need the count of the total records.

Please help thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-08 : 07:57:40
select count(*) from tblImports

gives you the count of records in the table with NO condition.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2010-06-08 : 08:14:24
Thank you webfred..
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-08 : 09:58:37
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -