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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 count files which don't exist in the database

Author  Topic 

wsqlw
Starting Member

8 Posts

Posted - 2008-09-12 : 05:31:03
I have a query like this:
Select video clips and write a query which will show me how many video clips are with the extension 3gp, how many with the extension gif and how many are with no extension.

The thing is that I do have clips with 3gp and with no extension, but I don't have any video clips with gif extension in my database, but still, I heft to count those too...
I know how to count clips that exist in my database, but how to count those that don't exist in my database?

Thanks in advance...

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-12 : 06:08:51
Hi, new ID ? or are you attending the same class as Stefan ?

Hint ! use LEFT JOIN


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

wsqlw
Starting Member

8 Posts

Posted - 2008-09-12 : 06:24:14
Actually, I am attending that same class.
How do you mean to use left join?

This is my query which counts clips with 3gp and no extension. They are both in the same table. But gif doesn't exist at all anywhere. I want it to count gif extension as well itself, not me to write it in the query.

select ekstenzija, count(*)
from dbo.contentcache
where command = 'vc'
group by ekstenzija

Thanks anyway...
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-12 : 06:31:38
do you have a table that stores all the value of ekstenzija ? use that to LEFT JOIN to this table


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

wsqlw
Starting Member

8 Posts

Posted - 2008-09-12 : 06:47:00
I don't know. but I'm not shure that would be it, my teacher says it's much simplier, just count gif with the rest, let the query do the counting...
Go to Top of Page
   

- Advertisement -