Hello everyone,
I'm trying to create a couple of SQL query that I need some help with...
I'm trying to create a SQL query that will do mass inserts into a table. I'm using a select statement with an embedded insert statement, but I realized that the insert statements allow one insert at a time and I have over 300 values that need to be inserted... does anyone know another, easier, or better way?
The other thing is, that I'm trying to also update/compute a field in one table (Table A) using the value from a field in another table (Table B) and subtracting it from say '10000' or something. I've tried to use a select statement to select the necessary fields from both tables then I tried to use an update subquery to do the computational stuff. ex:
select a.element, a.key, b.keys_avail
from table_a a, table_b b
where a.element=b.element
update table_b
set b.keys_avail=10000 - a.key <-- this is where i'm having the problem!
where ......blah,blah,blah..
so anyways if anyone can suggest a easier or better way to do this also i'd appreciate it.
Thanks
angel
I'm trying to create a couple of SQL query that I need some help with...
I'm trying to create a SQL query that will do mass inserts into a table. I'm using a select statement with an embedded insert statement, but I realized that the insert statements allow one insert at a time and I have over 300 values that need to be inserted... does anyone know another, easier, or better way?
The other thing is, that I'm trying to also update/compute a field in one table (Table A) using the value from a field in another table (Table B) and subtracting it from say '10000' or something. I've tried to use a select statement to select the necessary fields from both tables then I tried to use an update subquery to do the computational stuff. ex:
select a.element, a.key, b.keys_avail
from table_a a, table_b b
where a.element=b.element
update table_b
set b.keys_avail=10000 - a.key <-- this is where i'm having the problem!
where ......blah,blah,blah..
so anyways if anyone can suggest a easier or better way to do this also i'd appreciate it.
Thanks
angel