Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- location
- t1.username = t2.username AND t2.type != 3 AND t2.Location != null AND
- (t2.DateTime between t1.Datetime +15 min AND t1.Datetime -15)
- UserName, Type, Location
- SELECT
- id,
- username,
- type,
- COALESCE(location,
- CASE
- (SELECT id FROM table1 INNER JOIN table2 ON t1.username = t2.username WHERE t2.type != 3 AND t2.Location != null AND
- (t2.DateTime between t1.Datetime +15 min AND t1.Datetime -15))
- END) AS location,
- datetime
- FROM table_name
Add Comment
Please, Sign In to add comment