Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AccountID Property Value
- 123456 Status Active
- 123456 City Los Angeles
- 123456 RegistrationDate 2018-05-11 11:30:14.000
- 543210 Status Active
- 543210 City Las Vegas
- 543210 RegistrationDate 2018-05-11 11:13:14.000
- 888888 Status Inactive
- 888888 City Toronto
- 888888 RegistrationDate 2015-05-12 11:13:14.000
- AccountID Status RegistrationDate
- 123456 Active 2018-05-11 11:30:14.000
- 543210 Active 2018-05-11 11:30:14.000
- SELECT AccountID FROM Property
- WHERE Status = 'Active'
- AND RegistrationDate = '2018-05-11 11:30:14.000'
- SELECT
- a.AccountID
- FROM
- tbl AS a
- JOIN tbl AS b
- ON a.AccountID = b.AccountID
- WHERE
- a.Property = 'Status'
- AND a.Value = 'Active'
- AND b.Property = 'RegistrationDate'
- AND b.Value = '2018-05-11 11:30:14.000' ;
Add Comment
Please, Sign In to add comment