0
我在Postgres數據庫的表格中有兩列x,y座標。在postgresSQL中查找最大值/最小值對
我可以找到使用在x和y的極端:
select min(x), max(x), min(y), max(y)
from coords
如何分配這些變量是這樣的:
select min(x) as xmin, max(x) as xmax, min(y) as ymin, max(y) as ymax
from coords
實現
select y
from coords
where x = xmin
等。 ..獲得5億行數據集中的四個極值點? (練習的要點)
所需的select語句有效,但我不能使用「where」子句,因爲它表示xmin不是列。什麼是正確的方法,或者在不太可能的情況下,我正在使用正確的方法,請問什麼是正確的語法?
你明白了:D所以不妨投票你=) – bonCodigo
最快是最快的 - 每聲明600-640毫秒。 – DHBI