Mysql
 sql >> Database >  >> RDS >> Mysql

Intervalli specificati in base ai valori delle colonne in PostgreSQL

In SQL Server puoi farlo in questo modo:

;WITH CTE AS(
SELECT ROW_NUMBER() OVER(PARTITION BY CAST(wavelength AS INT)-CAST(wavelength AS INT)%10 ORDER BY wavelength) AS ROW_ID,wavelength,reflectance FROM Your_Table
)

SELECT wavelength,reflectance FROM CTE WHERE ROW_ID=1

Spero che possa essere d'aiuto.