469,939 Members | 2,441 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,939 developers. It's quick & easy.

Simple SQL help

SELECT COUNT(ID) AS TotalSupportIsses
FROM jirauser.jiraissue
WHERE (issuetype = '5') AND (issuestatus <> '6')

SELECT COUNT(ID) AS TotalCustomers
FROM jirauser.project
WHERE (pname LIKE 'Support%') AND (pname <> 'Support: Internal')

I need to divide the value of the first by the value of the second. So the first query returns 5 and the second query returns 10 so I need my stored proc to do 5/10.
Oct 26 '06 #1
1 1193
Try this:

DECLARE @CountID1 FLOAT
DECLARE @CountID2 FLOAT
DECLARE @Answer FLOAT

SELECT @CountID1=COUNT(ID)
FROM jirauser.jiraissue
WHERE (issuetype = '5') AND (issuestatus <> '6')

SELECT @CountID2=COUNT(ID)
FROM jirauser.project
WHERE (pname LIKE 'Support%') AND (pname <> 'Support: Internal')

SET @Answer=@CountID1/@CountID2

PRINT @Answer
Oct 27 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Patchwork | last post: by
reply views Thread by unixman | last post: by
17 posts views Thread by savesdeday | last post: by
2 posts views Thread by Don Wash | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.