ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Use multiple aggregate columns in pivot query in SQL Server<p>Hi <a class="username" rel="chetan"> chetan</a>,</p> <p>Refer below query.</p> <p><span style="text-decoration: underline;"><strong>SQL</strong></span></p> <pre class="brush: sql">CREATE TABLE #tblVisa(VisaModeId INT, VisaValidity Varchar(max),StayValidity Varchar(max), ProcessTime VARCHAR(max)) INSERT INTO #tblVisa VALUES(1,&#39;60 days from the date issue&#39;,&#39;14 days from date of entry&#39;,&#39;14 days from date of entry&#39;) INSERT INTO #tblVisa VALUES(2,&#39;30 days from the date issue&#39;,&#39;30 days from date of entry&#39;,&#39;14 days from date of entry&#39;) SELECT * FROM ( SELECT VisaModeId,[VisaValidity] FROM #tblVisa ) as tbl PIVOT(MAX(VisaValidity) FOR [VisaModeId] IN ([1],[2])) as PVT DROP TABLE #tblVisa</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/801750/Use-multiple-aggregate-columns-in-pivot-query-in-SQL-Server/https://www.aspforums.net:443/Threads/801750/Use-multiple-aggregate-columns-in-pivot-query-in-SQL-Server/Wed, 29 May 2019 04:21:10 GMTUse multiple aggregate columns in pivot query in SQL Server<p>Hi <a class="username" rel="chetan"> chetan</a>,</p> <p>Refer below link and provided by me query both take reference and change query itself.</p> <h1 class="header"><a class="title f16" href="https://www.aspforums.net:443/Threads/536555/Use-multiple-aggregate-columns-in-pivot-query-in-SQL-Server/">Use multiple aggregate columns in pivot query in SQL Server</a></h1> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/801750/Use-multiple-aggregate-columns-in-pivot-query-in-SQL-Server/https://www.aspforums.net:443/Threads/801750/Use-multiple-aggregate-columns-in-pivot-query-in-SQL-Server/Wed, 29 May 2019 06:41:38 GMT