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 2005 Forums
 Transact-SQL (2005)
 Need help with hard recursive request

Author  Topic 

tamiii
Starting Member

1 Post

Posted - 2008-07-04 : 08:59:48
Hi there,

I have a table <PROBLEMS> which contains these 3 fields :
- problem_id
- problem_date
- product_version

And I have to get the number of problem for each product_version per day (date). So I'll have as many columns as the number of product versions I have, + 1 column for the number of problems.

Eg : if I have 3 product versions, the resulted columns of my request will seem to =>
- date
- number of problems for version 1
- number of problems for version 2
- number of problems for version 3

Thanks a lot for your ideas.

Have a nice day !

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-07-04 : 09:42:08
please test this:
select
convert(varchar(10),problem_date,102) as problem_date,
count(*) as numProblems,
product_version
from Problems
group by
convert(varchar(10),problem_date,102),
product_version

Greetings
Webfred

There are 10 types of people in the world: Those who understand binary, and those who don't...
Go to Top of Page
   

- Advertisement -