Guest User

Untitled

a guest
Jun 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. AccountID Property Value
  2. 123456 Status Active
  3. 123456 City Los Angeles
  4. 123456 RegistrationDate 2018-05-11 11:30:14.000
  5. 543210 Status Active
  6. 543210 City Las Vegas
  7. 543210 RegistrationDate 2018-05-11 11:13:14.000
  8. 888888 Status Inactive
  9. 888888 City Toronto
  10. 888888 RegistrationDate 2015-05-12 11:13:14.000
  11.  
  12. AccountID Status RegistrationDate
  13. 123456 Active 2018-05-11 11:30:14.000
  14. 543210 Active 2018-05-11 11:30:14.000
  15.  
  16. SELECT AccountID FROM Property
  17. WHERE Status = 'Active'
  18. AND RegistrationDate = '2018-05-11 11:30:14.000'
  19.  
  20. SELECT
  21. a.AccountID
  22. FROM
  23. tbl AS a
  24. JOIN tbl AS b
  25. ON a.AccountID = b.AccountID
  26. WHERE
  27. a.Property = 'Status'
  28. AND a.Value = 'Active'
  29.  
  30. AND b.Property = 'RegistrationDate'
  31. AND b.Value = '2018-05-11 11:30:14.000' ;
Add Comment
Please, Sign In to add comment