Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT id INTO var_name FROM table1 WHERE some_column='something' LIMIT 1;
- INSERT INTO table2 (`number`) VALUES (@var_name);
- INSERT INTO table2 (`number`)
- SELECT id FROM table1 WHERE some_column='something' LIMIT 1
- declare @var_name varchar(100);
- SELECT id INTO @var_name FROM table1 WHERE some_column='something' LIMIT 1;
- INSERT INTO table2 (`number`) VALUES (@var_name);
- insert into table2 ('number')
- select id
- from table1
- where some_column = 'something' LIMIT 1;
Add Comment
Please, Sign In to add comment