You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
704 B
51 lines
704 B
SET QUOTED_IDENTIFIER ON
|
|
GO
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|
|
|
|
|
|
|
|
|
|
CREATE PROCEDURE sp_CategorizeBuckets
|
|
@ip_Followup varchar(50),
|
|
@ip_SortBy varchar(100)
|
|
AS
|
|
|
|
BEGIN
|
|
-- sort by bucketid
|
|
|
|
IF (@ip_SortBy = 'BucketId' OR @ip_SortBy = 'Bucket')
|
|
BEGIN
|
|
select BucketId,
|
|
Instances,
|
|
BugId AS Bug
|
|
from BucketCounts
|
|
WHERE Followup = @ip_Followup
|
|
order by BucketId
|
|
END
|
|
|
|
-- sort by #Instances
|
|
|
|
IF (@ip_SortBy = 'Instances')
|
|
BEGIN
|
|
select BucketId,
|
|
Instances,
|
|
BugId AS Bug
|
|
from BucketCounts
|
|
WHERE Followup = @ip_Followup
|
|
order by Instances DESC
|
|
END
|
|
|
|
END
|
|
|
|
|
|
|
|
|
|
|
|
GO
|
|
SET QUOTED_IDENTIFIER OFF
|
|
GO
|
|
SET ANSI_NULLS ON
|
|
GO
|
|
|