Last active
July 9, 2018 15:52
-
-
Save steklopod/bbbf7b829dfdcf4be32e5005dbcc5b5f to your computer and use it in GitHub Desktop.
Generate data from sequence MySQL
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
CREATE DATABASE IF NOT EXISTS `ifd_test`; | |
START TRANSACTION; | |
USE `ifd_test`; | |
TRUNCATE TABLE esb_out_a_report; # из -> | |
TRUNCATE TABLE esb_out_h_report; # -> в | |
INSERT INTO esb_out_a_report (message_id, entity_id, maintenance_flg, message_dt, operation_code, receiver_id) | |
SELECT | |
seq, | |
CONCAT('id #', seq), | |
RAND(), | |
SUBDATE(CURRENT_DATE, 1), | |
RAND() * 666, | |
seq + rand() * 13 | |
FROM seq_1_to_10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment