我要插入值的範圍爲我的表插入範圍
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