hi,
i have 2 tables:
currency rates
+-----------------+ +--------------------+
| code char(3) | |currency char(3) |
| name varchar(10)| |rate double |
|bcurrency char(1)| | ryear varchar(4) |
| | | rmonth varchar(10) |
+-----------------+ +--------------------+
I'm have a form, from which i pick 2 value "2000" and "february".
I'm trying to insert fields form currency to rates, matching particular
conditions in order to avoid data duplication.
The rate table basically has the exchange rate for a particular currency
in a particular year and a particular month.
The trio currency,ryear,rmonth SHOULD be unique.
My query is the following:
insert into rates (currency,ryear,rmonth)
select a.code, "2000", "february" from currency a, rates b
where a.bcurrency="N"
and a.code<>b.currency and b.ryear="2000" and b.rmonth="february"
i have 2 tables:
currency rates
+-----------------+ +--------------------+
| code char(3) | |currency char(3) |
| name varchar(10)| |rate double |
|bcurrency char(1)| | ryear varchar(4) |
| | | rmonth varchar(10) |
+-----------------+ +--------------------+
I'm have a form, from which i pick 2 value "2000" and "february".
I'm trying to insert fields form currency to rates, matching particular
conditions in order to avoid data duplication.
The rate table basically has the exchange rate for a particular currency
in a particular year and a particular month.
The trio currency,ryear,rmonth SHOULD be unique.
My query is the following:
insert into rates (currency,ryear,rmonth)
select a.code, "2000", "february" from currency a, rates b
where a.bcurrency="N"
and a.code<>b.currency and b.ryear="2000" and b.rmonth="february"