Search
 
SCRIPT & CODE EXAMPLE
 

SQL

min max sql

SELECT MIN(salary), MAX(salary) FROM employees;
SELECT team, MIN(salary), MAX(salary) FROM employees GROUP BY team;
Comment

sql max min

select emp_name, salary
from employees
where salary = (select max(salary) from employees)
union all
select emp_name, salary
from employees
where salary = (select min(salary) from employees);
Comment

min max in sql

SELECT MIN(column_name),
MAX(column_name),
AVG(column_name)
FROM table_name
WHERE condition;
Comment

SQL MAX() and MIN() with Strings

SELECT MIN(first_name) AS min_first_name
FROM Customers;
Comment

PREVIOUS NEXT
Code Example
Sql :: mariadb check constraint example? 
Sql :: inserting values in sql 
Sql :: create user in mysql 
Sql :: order by postgres 
Sql :: postgresql connect 
Sql :: mysql shell set time_zone 
Sql :: how to populate a table in MySQL from and existing csv file 
Sql :: cast in sql server 
Sql :: mysql comparing dates 
Sql :: create database with hyphen sign mysql 
Sql :: mysql trigger to delete old data 
Sql :: sql is null or empty 
Sql :: how to order a union sql 
Sql :: sql stored procedure output parameters 
Sql :: mysql replace empty string with null 
Sql :: load a log file in that format into MySQL 
Sql :: sql double quotes in string 
Sql :: rename command in sql 
Sql :: SQLSTATE[42S02]: Base table or view not found: 1146 Tabl 
Sql :: postgresql cast string to int 
Sql :: query params sql insert python f string 
Sql :: get relation data in mysql using query to excel 
Sql :: mysql create link between tablesdatabase 
Sql :: how to order result of subquery in select 
Sql :: vbscript clean up ADODB.Recordset 
Sql :: how to set up service broker in sql server 
Sql :: how to make trigger in phpmyadmin 
Sql :: sql server bool select 
Sql :: how to get employee having maximum experience in mysql 
Sql :: mysql missin expression near on 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =