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

min max in sql

SELECT MIN(column_name),
MAX(column_name),
AVG(column_name)
FROM table_name
WHERE condition;
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 :: postgresql populate data random 
Sql :: insert or update cassandra 
Sql :: mysqldump password in file 
Sql :: duplicate key value violates unique constraint "django_admin_log_pkey" 
Sql :: longtext sql 
Sql :: create column that already exists mysql 
Sql :: truncate table sql server foreign key 
Sql :: sqlalchemy default value for column 
Sql :: how to find columns with null values in sql 
Sql :: postgresql create table add unique constraints 
Sql :: psql invalid command N 
Sql :: learn sql 
Sql :: Oracle cx_Oracle example 
Sql :: SQL CREATE INDEX Constraint 
Sql :: what does leave do in mysql 
Sql :: sqlite3 python foreign key 
Sql :: sql server get week dates from week number 
Sql :: sql order by clause 
Sql :: sql query for displaying age from oldest to youngest 
Sql :: incorrect datetime value sql table error 1292 
Sql :: install mssql on ubuntu 
Sql :: Insert Multiple Rows at Once in SQL 
Sql :: column with prefix in sql 
Sql :: insert to first table if field A equals field B from a second table using sql 
Sql :: Why mysql is used? 
Sql :: not in sql 
Sql :: sql limit 
Sql :: iterative instruction sql 
Sql :: grant privileges mysql to database 1064 
Sql :: delphi split datetime 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =