1SELECT MAX(<numeric column>) FROM <table>;
2SELECT MAX(<numeric column>) FROM <table> GROUP BY <other column>;
1SELECT MAX(salary) FROM employees;
2SELECT id, MAX(salary) FROM employees GROUP BY id;
3
4SELECT t1.*
5FROM employees t1
6INNER JOIN (
7 SELECT id, max(salary) AS salary FROM employees GROUP BY id
8) t2 ON t1.id = t2.id AND t1.salary = t2.salary;
1ALTER TABLE dbo.mytable ADD CONSTRAINT CK_HAPPINESS_MAX CHECK (PokemonHappiness <= 10000)
2