Skip to content

Tag: sql-server

Get max of sum during joining two tables

I want to get the subscriber that has maximum value of Bill (Total Bill). I tried using the following script but SQL did not execute successflly. Please help me on what I did wrong on this. I have 2 tables: Subscriber FirstName MIN Ben 258999542 Reed 458524896 Steve 586692155 Clint 1007772121 Frank 1287548752…

Get pair-wise single row

I have some data in a MS SQL Server database. Sample data is: Sl ColumnA ColumnB 1 111 112 2 112 111 3 113 114 4 114 113 5 115 116 6 116 115 Now I need result like. ColumnA ColumnA 111 112 113 114 115 116 Notice here: In Sl 1 number Column A = Sl 2 Column B