V Valter Active member Mar 19, 2014 #1 What would be mysql query to set user's registration-date to their first-post-date for usergroup X? Many thanks.
What would be mysql query to set user's registration-date to their first-post-date for usergroup X? Many thanks.
Jake Bunce Well-known member Mar 20, 2014 #2 Code: UPDATE xf_user AS u SET u.register_date = ( SELECT p.post_date FROM xf_post AS p WHERE p.user_id = u.user_id ORDER BY p.post_date ASC LIMIT 0,1 ) WHERE u.user_group_id = 2 Backup first. Upvote 0 Downvote
Code: UPDATE xf_user AS u SET u.register_date = ( SELECT p.post_date FROM xf_post AS p WHERE p.user_id = u.user_id ORDER BY p.post_date ASC LIMIT 0,1 ) WHERE u.user_group_id = 2 Backup first.