Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server select rows by distinct column

SELECT a.*
FROM emails a
INNER JOIN 
  (SELECT email,
    MIN(id) as id
  FROM emails 
  GROUP BY email 
) AS b
  ON a.email = b.email 
  AND a.id = b.id;
Comment

sql server select rows by distinct column

SELECT a.*
FROM emails a
INNER JOIN 
  (SELECT email,
    MIN(id) as id
  FROM emails 
  GROUP BY email 
) AS b
  ON a.email = b.email 
  AND a.id = b.id;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql generate create table script 
Sql :: mysql select inside sum 
Sql :: mysql date_format 
Sql :: delete record mysql 
Sql :: SQL FETCH FIRST Clause 
Sql :: get month sql 
Sql :: sql where is not number 
Sql :: mysql sql.gz 
Sql :: UNION ALL LEFT JOIN 
Sql :: install mysql 
Sql :: plpgsql coalesce equivalent for empty string 
Sql :: peewee print sql 
Sql :: postgresql find blocked query 
Sql :: alter session set nls_language french 
Sql :: insert data into multiple tables mysql 
Sql :: case vhdl 
Sql :: compress sql file database ubuntu 
Sql :: dns slave zone convert 
Sql :: Question 7: Write an SQL query to print details of the Workers who have joined in Feb’2014. 
Sql :: sql with as 
Sql :: how to use select union and loop 
Sql :: how to connect sqlalchemy to mysql and deploy it 
Sql :: mysql dump structure only 
Sql :: flask sqlalchemy remove duplicates 
Sql :: sql into 
Sql :: creashed table mysql 
Sql :: sql like with multiple values 
Sql :: sql is not like 
Sql :: test database for sql 
Sql :: column must appear in the GROUP BY clause or be used in an aggregate function 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =