Query Problem [message #171083] |
Mon, 08 May 2006 05:21 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
samit_gandhi
Messages: 226 Registered: July 2005 Location: Hong Kong
|
Senior Member |
![samit_gandhi](/forum/theme/orafaq/images/yahoo.png)
|
|
Dear All,
I have one query problem which is urgent to short out. Please help me.
I have one ref_master table in which there is ref_no and company_id is a primary key. I am trying to insert the record in the following way in my button press trigger on the form.
The query is like this :
insert into ref_master(ref_no,ref_code,ref_group,group_code,company_id,unit,
opening_stock_qty, opening_rate_usd,opening_rate_hkd,opening_amt_usd,
opening_amt_hkd,our_rate_hkd,our_rate_usd,marks)
select ref_no,ref_sequence.nextval,ref_group,group_code,2,G,0,0,0,0,0,0,0,0
from ref_master
where ref_no in (select ref_no from ref_master where company_id=1
minus
select ref_no from account.ref_master where company_id=2);
Here Company_id 1 have many records i want to copy all records in company_id 2.
Pleas help me it is urgent.
Samit
|
|
|
|