Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Calculate Maximum three values from table in SQL

$
0
0
Hi all,I have a requirement where I have to calculate maximum three values from a table.Table1ID Column1 B122 B133 B144 B155 B166 F127 F138 F149 F1510 F16So I want take max(column) and max(column)-3 i.e. ID's with column like '%16,15,14%' is what i wantOutput TableID column 3 B144 B155 B168 F149 F1510 F16how can I do this?

Viewing all articles
Browse latest Browse all 3145

Trending Articles