roedelfroe
Programmer
Hi,
following problem:
I need to update some rows in a table. All information, which colums are to be updated are in the table itself.
For example, following statement does exactly, what I want:
update basis_table set factor =
(
select factor from basis_table
where type = 'STK' and id_group in ('1','2') and date =
(
select max(date) fro basis_table where id = '1234'
)
and id '1234'
)
where type = 'CER' and id_group in ('511','512') and id = '1234'
As you can see, it works for a GIVEN id. Now I need a statement, which will update all id's whith the 'factor', which is related to this id.
Can anybody help me?
Thx in advance
following problem:
I need to update some rows in a table. All information, which colums are to be updated are in the table itself.
For example, following statement does exactly, what I want:
update basis_table set factor =
(
select factor from basis_table
where type = 'STK' and id_group in ('1','2') and date =
(
select max(date) fro basis_table where id = '1234'
)
and id '1234'
)
where type = 'CER' and id_group in ('511','512') and id = '1234'
As you can see, it works for a GIVEN id. Now I need a statement, which will update all id's whith the 'factor', which is related to this id.
Can anybody help me?
Thx in advance