Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
2.54/5 (3 votes)
Hi i am using following code....plzz let me know how to get count i.e number of rows affected.

SQL
Select ACCOUNT.ACCOUNT,OPPORTUNITY.OPPORTUNITYID,OPPORTUNITY.STAGE,OPPORTUNITY.STATUS,
SECCODE.SECCODEDESC,SECCODE.SECCODEID
from OPPORTUNITY
Inner Join ACCOUNT on OPPORTUNITY.SECCODEID=ACCOUNT.SECCODEID
Inner join SECCODE on OPPORTUNITY.SECCODEID=SECCODE.SECCODEID
where SECCODE.SECCODEID in ('F6UJ9A00000A','F6UJ9A000007','F6UJ9A000009','F6UJ9A000003') and OPPORTUNITY.STATUS in ('Lost/Dead')
Posted
Comments
thatraja 15-Oct-13 9:25am    
Not clear, rephrase your question clearly
Kschuler 15-Oct-13 9:31am    
Do you just want the count of how many rows are pulled back from the join? If so, just add COUNT(*) to the SELECT.

1 solution

You can select System variable @@ROWCOUNT after executing your query:
SQL
select @@ROWCOUNT
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900