Reputation: 3215
I have a table with following schema
Sample table
email | name | address
[email protected] | A | CA
I want the same set of record with five different static email addresses
Expected output
email | name | address
[email protected] | A | CA
[email protected] | A | CA
[email protected] | A | CA
[email protected] | A | CA
[email protected] | A | CA
Is this possible?
Upvotes: 0
Views: 128
Reputation: 92845
Try
SELECT CONCAT('static', @n := @n + 1, '@', SUBSTRING_INDEX(email, '@', -1)) email,
`name`,
address
FROM table1 CROSS JOIN
INFORMATION_SCHEMA.COLUMNS JOIN
(SELECT @n := 0) n
LIMIT 5
Output:
| EMAIL | NAME | ADDRESS |
--------------------------------------
| [email protected] | A | CA |
| [email protected] | A | CA |
| [email protected] | A | CA |
| [email protected] | A | CA |
| [email protected] | A | CA |
Upvotes: 1