---
title: "How i can use Pivot Operator?"  
description: "How i can use Pivot Operator?"  
author: "Niraj Kumar Mishra"  
published: 2017-08-22  
updated: 2017-08-23  
canonical: https://www.mindstick.com/forum/34329/how-i-can-use-pivot-operator  
category: "mssql server"  
tags: ["database"]  
reading_time: 1 minute  

---

# How i can use Pivot Operator?

I have a [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) saller that have following record..\
![How i can use Pivot Operator?](https://www.mindstick.com/mindstickforums/8dea61c2-2825-4ef4-ba5d-37e413880796/images/2eb5fa55-6103-444f-a9c6-9c4799787aec.png)\
\
and i want a query that give the total ProductSale result with respect to Name Colmn Like this... City Rahul Mohit Thakur Allahabad 300 200 500 Jhunsi something... Phaphamau something..........\
if i use group by keyword then it not give the correct result...please help..\
\
\
\
\

## Replies

### Reply by Samuel Fernandes

Hi Niraj you check following query by using Pivot operator it produced same output that you are aspects..\

```
     select *from Saller     pivot     (     sum(ProductSale) for Name in([Rahul],[Mohit],[Thakur])     )as Pivottableoutput is:best of luck...
```


---

Original Source: https://www.mindstick.com/forum/34329/how-i-can-use-pivot-operator

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
