Click here to Skip to main content
15,914,608 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
can i use over clause after from table on sql server 2012 ?
I have technical question
can i use over clause over count after make select from table
to make count rows

What I have tried:

SQL
select partid,product
from product
count(partid) over
Posted
Updated 15-Mar-21 22:52pm
v2

 
Share this answer
 
Comments
Maciej Los 16-Mar-21 4:15am    
5ed!
You have already asked 289 questions, most of them about SQL!

I'd suggest you to buy good book about SQL. Read it, read it again and read it every time before you ask a question. MSDN documentation is obligatory reading too!

Do you know what people think about such of lazy programmer?

As to your qustion... Have you tried to execute your query?
Please, do not answer. I know the answer: No, you don't! Because you'll know that this statement is wrong!

To get count of records:
SQL
select partid, product, COUNT(*) OVER(ORDER BY partid) CountOfRecordsInProductTable
from product;


More detalis at: COUNT (Transact-SQL) - SQL Server | Microsoft Docs[^]
 
Share this answer
 
v2

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