hi folks,
i'm searching for a way to get from two coloumns (lets say: posx and posy) the global (whole table) maximum and minimum with just one query.
Database is MySQL
thanks
hi folks,
i'm searching for a way to get from two coloumns (lets say: posx and posy) the global (whole table) maximum and minimum with just one query.
Database is MySQL
thanks
SELECT
MIN(colx) AS minimum,
MAX(colx) AS maximum,
MIN(coly) AS minimum,
MAX(coly) AS maximum
FROM table
Simple:
SELECT MIN(posx), MIN(posy), MAX(posx), MAX(posy) FROM table
It's really no more complex than it sounds.
SELECT MIN(posx), MAX(posx), MIN(posy), MAX(posy)
FROM yourtable