All pastes #435125 Raw Edit

Mine

public sql v1 · immutable
·published 2007-04-11 19:51 UTC
rendered paste body
SELECT distinct(ph.id) AS id, ph.created as phasecreated, pf.created as filecreated, ph.name AS name, ph.phasetype AS phasetype    FROM phases AS phLEFT JOIN projectfiles AS pf ON ph.id = pf.phase_id    AND pf.created >= DATE_SUB(CURDATE(),INTERVAL 1 DAY)WHERE ph.phasetype = 'drawing'RESULTS:+----+---------------------+---------------------+------------------------------------+-----------+| id | phasecreated        | filecreated         | name                               | phasetype |+----+---------------------+---------------------+------------------------------------+-----------+|  2 | 2007-03-22 14:26:48 | NULL                | Test Drawing Phase for Project 4   | drawing   | |  3 | 2007-03-26 11:17:20 | NULL                | Second Drawing Phase for Project 4 | drawing   | |  5 | 2007-04-11 13:00:39 | 2007-04-11 13:02:58 | Drawing Phase for Project 3        | drawing   | |  7 | 2007-04-11 14:53:15 | NULL                | Test Drawing Phase for Project 2   | drawing   | +----+---------------------+---------------------+------------------------------------+-----------+