Created
October 30, 2010 05:38
-
-
Save donamkhanh/655001 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE prepaid_pack p | |
INNER JOIN booking_detail bd | |
ON bd.pack_id = p.pack_id AND bd.related_pack_id = p.pack_id | |
SET first_used_date = ( | |
SELECT MIN(booked_date) | |
FROM booking_detail | |
WHERE pack_id = p.pack_id AND related_pack_id = p.pack_id | |
) | |
WHERE p.ad_type != 'subscription' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment