Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql display max value

SELECT MAX(<numeric column>) FROM <table>;
SELECT MAX(<numeric column>) FROM <table> GROUP BY <other column>;
Comment

sql max value in column

SELECT MAX(salary) FROM employees;
SELECT id, MAX(salary) FROM employees GROUP BY id;

SELECT t1.*
FROM employees t1
INNER JOIN (
    SELECT id, max(salary) AS salary FROM employees GROUP BY id
) t2 ON t1.id = t2.id AND t1.salary = t2.salary;
Comment

sql max count

SELECT max(MY_COLUMN) FROM my_table; 
SELECT MY_ID, max(MY_COLUMN) FROM my_table GROUP BY ID;   -- Max by MY_ID
Comment

find max number in sql

● SELECT first-name, MAX(salary)
FROM department d LEFT OUTER JOIN employee e ON (d.department_id = e.department_id)
GROUP BY department_id;
Comment

PREVIOUS NEXT
Code Example
Sql :: Concatenate columns in table 
Sql :: sqlite trim 
Sql :: mysql privileges 
Sql :: sql query for displaying age from oldest to youngest 
Sql :: update select sql 
Sql :: sql change primary key to composite key 
Sql :: drop specific row postgresql 
Sql :: t sql return on letters only 
Sql :: sql server download for windows 10 64 bit 
Sql :: postgres enumerated type 
Sql :: update database collation in postgresql 
Sql :: sql remove duplicates based on column 
Sql :: arithmetic expression in sql 
Sql :: store date time in mysql 
Sql :: Selecting from a view SQL 
Sql :: SQL Using Prepared Statements 
Sql :: table user postgres 
Sql :: indexing in mysql 
Sql :: alter in mysql 
Sql :: recourse record format 
Sql :: mysql workbench reset performance reports 
Sql :: decode plsql 
Sql :: delete and start from 1 primary key muysql 
Sql :: sql update from two different database 
Sql :: oracle execute immediate quotes 
Sql :: exel bulk insert 
Sql :: ring MySQL create new table and insert records 
Sql :: qt qsql check if table exist 
Sql :: database restoring error 
Sql :: python simple crud application using sqlite 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =