Search
 
SCRIPT & CODE EXAMPLE
 

SQL

get last date join sql

SELECT customer.*, purchase.*
FROM customer
JOIN (
   SELECT DISTINCT ON (customer_id) *
   FROM purchase
   ORDER BY customer_id, date DESC
) purchase ON purchase.customer_id = customer.id
Comment

PREVIOUS NEXT
Code Example
Sql :: new rails app with mysql 
Sql :: like postgres 
Sql :: plpgsql 
Sql :: sql check 
Sql :: where keyword sql 
Sql :: mysql create database 
Sql :: identity column in sql server 
Sql :: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client . Can not run php artisan migrate 
Sql :: sql where statement 
Sql :: specify regex check on column constraint sqlalchemy 
Sql :: SELECT statement to find the specific cell in database table 
Sql :: SQL Server dynamic pivot unknown number of columns 
Sql :: make a socket server to detect changes in mysql 
Sql :: oracle sql date winter time 
Sql :: mysql coonect sample code 
Sql :: mysql config address 
Sql :: contraint default SQL 
Sql :: from UCSC MySQL database Use database hg38. 
Sql :: SQL Primary Key single column 
Sql :: plus or add balance in postgresql sql 
Sql :: creating h2 database in relative directory eclopse 
Sql :: how to use multiple transactions in sql server 
Sql :: Find Last Fractal Function MQL4 
Sql :: Getting error while running 50 MB script on SQL Server 
Sql :: dynamic pivot 
Sql :: mysql grant execute 
Sql :: find invalid datetime field 
Sql :: modify xml in sql server 
Sql :: goto in SQL server in production 
Sql :: sql how to display two atributes as one in sql 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =