Inserting data into a table (subselect?)
Posted: Thu Jun 05, 2003 3:14 pm
insert into enrolls (section_id,total)
values(324,max(sub) +.1);
how can I make it work so the value for the total of this entry is the max of the sub column from the same table + .1
i've tried: values(324,(SELECT max(sub) FROM enrolls) +.1);
but it does not work because its against the rules to take the max from the same table your inserting into.
values(324,max(sub) +.1);
how can I make it work so the value for the total of this entry is the max of the sub column from the same table + .1
i've tried: values(324,(SELECT max(sub) FROM enrolls) +.1);
but it does not work because its against the rules to take the max from the same table your inserting into.