SELECT t1.*
FROM employees t1
INNER JOIN (
SELECT id, min(salary) AS salary FROM employees GROUP BY id
) t2 ON t1.id = t2.id AND t1.salary = t2.salary;
SELECT * FROM MyTable
ORDER BY MyCol ASC LIMIT 100
SELECT DISTINCT
t1.CompliancyID ,t1.[Status],t1.FK_ClientID
FROM #VettingCompliance t1
INNER JOIN
(
SELECT FK_ClientID, min(CompliancyID) AS CompliancyID FROM #VettingCompliance GROUP BY FK_ClientID
) t2 ON t2.CompliancyID = t1.CompliancyID AND t1.FK_ClientID = t2.FK_ClientID
Code Example |
---|
Sql :: sql select min row |
Sql :: sqlserver add column |
Sql :: q operator in plsql |
Sql :: sql find table by name |
Sql :: oracle all_dependencies |
Sql :: drop schema sql |
Sql :: mysql url data type |
Sql :: mysql count characters in string |
Sql :: postgresql full text search |
Sql :: SQL Duplicates by Composite |
Sql :: call postgres function |
Sql :: date sql |
Sql :: encrypt and decrypt in sql server |
Sql :: uppercase sql |
Sql :: mysql auto increment column |
Sql :: mysql add to value |
Sql :: sql column to row |
Sql :: image for MSSQL Windows Docker |
Sql :: sql server change column data type |
Sql :: sql server check whether column has same equal values |
Sql :: sql server port |
Sql :: postgres get number of days between two dates |
Sql :: mysql timezone |
Sql :: oracle create package body |
Sql :: update value sql |
Sql :: update table sql multiple set |
Sql :: express mysql |
Sql :: insert into sql |
Sql :: sql server: how to concatenate column data using comma |
Sql :: copy a table mysql |