Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. SELECT
  2. my1.data AS PAW_ID,
  3. abc.abc_medium AS abc_Medium,
  4. my.data AS Trial_Date,
  5. my2.data AS Upgrade_Date,
  6. my3.lastmod AS Cancel_Date
  7.  
  8. 123 | email | 1-1-2014 | 2-1-2014 | 3-1-2014
  9. 123 | banner| 4-1-2014 | 2-1-2014 | 3-1-2014
  10.  
  11. SELECT columnsIWant
  12. FROM tables
  13. JOIN otherTables ON conditions
  14. JOIN (SELECT paw_id, MIN(created) AS minDate
  15. FROM def208
  16. GROUP BY paw_id) tempTable
  17. ON tempTable.paw_id = realTable.paw_id AND tempTable.minDate = realTable.created;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement