“2 nilai maks di SQL” Kode Jawaban

SQL MAX dari dua nilai

-- For SQL Server >= 2008
SELECT [Other Fields],
  (SELECT Max(v) 
   FROM (VALUES (date1), (date2), (date3),...) AS value(v)) as [MaxDate]
FROM [YourTableName]

/* Note (from comments): From value(v), "value" is the alias for the 
 * virtual table and "v" is the name of the virtual column of the date values.
 */
one1lion

2 nilai maks di SQL

SELECT MAX (column_name) 
FROM table_name 
WHERE column_name NOT IN (SELECT Max (column_name) 
                          FROM table_name);
Old-fashioned Otter

Jawaban yang mirip dengan “2 nilai maks di SQL”

Pertanyaan yang mirip dengan “2 nilai maks di SQL”

Lebih banyak jawaban terkait untuk “2 nilai maks di SQL” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya