Skip to content
Advertisement

Display null if only one value for Min(Column) and Max(column) SQL query

This is my original table

Desired output:

Current output with my query

Query:

Advertisement

Answer

You can get your expected output from your sample input:

See it in action: SQL Fiddle You should probably add some aliases to at least one set of columns.

Not sure, though, how you got two rows of data with your sample query.

Please comment, if and as this requires adjustment / further detail.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement