Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO cards (`card_number`, `card_status`, `bank_account_id`)
- SELECT DISTINCT REVERSE(cs.`full_name`) AS `card_number`,
- 'Active' AS `card_status`,
- ba.`client_id` AS `bank_account_id`
- FROM clients AS cs
- JOIN bank_accounts AS ba
- ON ba.`client_id` = cs.`id`
- JOIN cards AS c
- ON c.`bank_account_id` = ba.`id`
- WHERE cs.`id` BETWEEN 190 AND 200;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement