我要插入值的范围为我的表插入范围
create TEMPORARY TABLE IF NOT EXISTS currency_numbers(
num INT
);
insert into currency_numbers(num) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
insert into pm_transaction_type (tran_type, fixed, rate, min_by_rate, max_by_rate, round, min_amount, max_amount, country_code, valid_since, valid_till, currency)
select 'fee.transfer_other_free', null, 0.1, 0, null, 0, null, null, "", null, null, currency_numbers.num
from currency_numbers
union
select 'fee.transfer_tip_free', null, 0.3, 4, null, 5, null, null, "", null, null, currency_numbers.num
from currency_numbers;
在这个例子中,我使用2条select语句的联合,价值观(MySQL的),但我想用联盟与约10不幸的是,我收到以下错误:
Can't reopen table: 'currency_numbers'
我怎么可以这样写查询,希望无需重复或者每一次的属性名称的列表的数目?
我只是认为我会添加一个不是第一个select子句需要标签的原因是否则MySQL会抱怨重复的空列 – Casebash 2012-01-03 23:29:12